/*java jdk 1.7+
# -*- coding: utf-8 -
'''
Created on 2020年05月10日
@author: zxyong 13738196011
'''*/

package com.zxy.business;

import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import com.zxy.common.Com_Fun;
import com.zxy.common.Com_Para;
import com.zxy.common.Db_Common_InterFace;
import com.zxy.common.PooledConnection_InterFace;
import com.zxy.db1.DBManager1;
import com.zxy.db1.Db_Common1;
import com.zxy.db2.DBManager2;
import com.zxy.db3.DBManager3;
import com.zxy.db4.DBManager4;
import com.zxy.db5.DBManager5;
import com.zxy.db6.DBManager6;
import com.zxy.db7.DBManager7;
import com.zxy.db8.DBManager8;
import com.zxy.db9.DBManager9;
import com.zxy.db10.DBManager10;
import com.zxy.db1.PooledConnection1;
import com.zxy.db10.Db_Common10;
import com.zxy.db10.PooledConnection10;
import com.zxy.db2.Db_Common2;
import com.zxy.db2.PooledConnection2;
import com.zxy.db3.Db_Common3;
import com.zxy.db3.PooledConnection3;
import com.zxy.db4.Db_Common4;
import com.zxy.db4.PooledConnection4;
import com.zxy.db5.Db_Common5;
import com.zxy.db5.PooledConnection5;
import com.zxy.db6.Db_Common6;
import com.zxy.db6.PooledConnection6;
import com.zxy.db7.Db_Common7;
import com.zxy.db7.PooledConnection7;
import com.zxy.db8.Db_Common8;
import com.zxy.db8.PooledConnection8;
import com.zxy.db9.Db_Common9;
import com.zxy.db9.PooledConnection9;
import com.zxy.db_Self.Db_Common_Self;
import com.zxy.db_Self.PooledConnection_Self;
import com.zxy.model.Oracle_Columns;
import com.zxy.model.T_DB_CONFIG;
import com.zxy.model.T_PARAM_VALUE;
import com.zxy.model.T_PROC_INPARAM;
import com.zxy.model.T_PROC_NAME;
import com.zxy.model.T_PROC_OUTPARAM;
import com.zxy.model.T_PROC_RETURN;
import com.zxy.model.T_SUB_POWER;
import com.zxy.model.T_SUB_SYS;
import com.zxy.model.T_SUB_USER;
import com.zxy.model.T_SUB_USERPOWER;
import com.zxy.model.cal_fun;
import com.zxy.model.cal_run;
import com.zxy.model.cal_run_param;
import com.zxy.model.cal_run_step;
import com.zxy.model.cal_variables;

public class Ope_DB_Cent
{
	public int iCount = 0;

	private void run_sql_example()
	{
		// 执行数据库操作
		java.sql.ResultSet rs = null;
		StringBuilder sqlException = null;
		PooledConnection_InterFace pi = null;
		Db_Common_InterFace dbc = null;

		try
		{
			// 根据不同数据源获取通用数据库调用方法
			Ope_DB_Cent odc = new Ope_DB_Cent();
			Object dbcobject = odc.Get_Db_Common(1);
			dbc = (Db_Common_InterFace) (odc.Obj_To_Db_Common(dbcobject));
			// 带参数
			// rs =
			// dbc.Common_Sql_Proc(param_name,Parameters,ParamTypes,ParamOutName,ParamOutType,pcl.getTpn());
			// 执行sql
			rs = dbc.Common_Sql(new StringBuilder("select 1 from dual"));
			//sql异常信息
			sqlException = dbc.getSqlException();
			pi = (PooledConnection_InterFace) dbc.getConn_a();
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
				if(!java.util.Objects.equals(dbc,null) && !pi.isB_nocursor())
				{
					if(!java.util.Objects.equals(pi,null)
							&& !java.util.Objects.equals(pi.getCalls(),null))
						pi.getCalls().close();
				}else if(!java.util.Objects.equals(dbc,null))
				{
					pi.returnConnection();
				}
			}
			catch(SQLException e)
			{
				Com_Fun.debug_in(e,this.toString(),"db close");
			}
		}
	}
	
	//获取菜单标题
	public String get_menu_title(String menuUrl){		
		String strResult = "";
		StringBuilder strSql = new StringBuilder();
		strSql.append("SELECT MENU_NAME FROM menu_info where MENU_URL = '"+menuUrl+"'");
		Db_Common_Self db_self = new Db_Common_Self();
		ResultSet rs = db_self.Common_Sql(strSql);
		try
		{
			while(rs.next())
			{
				strResult = rs.getString("MENU_NAME");
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			if(!java.util.Objects.equals(rs,null))
			{
				try
				{
					rs.getStatement().close();
					rs.close();
				}
				catch(SQLException e)
				{
				}
			}
		}
		return strResult;
	}
	public void Init_Load()
	{
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_param_value order by s_sort,MAIN_ID asc");
		Db_Common_Self db_self = new Db_Common_Self();
		ResultSet rs = db_self.Common_Sql(strSql);
		try
		{
			boolean bSessionAva = false;
			while(rs.next())
			{
				T_PARAM_VALUE tp = new T_PARAM_VALUE();
				tp.MAIN_ID = rs.getInt("MAIN_ID");
				if(rs.getString("PARAM_KEY").equals("AccSocketPort"))
				{
					Com_Para.AccSocketPort = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "AccSocketPort";
					tp.PARAM_VALUE = String.valueOf(Com_Para.AccSocketPort);
				}else if(rs.getString("PARAM_KEY").equals("Inf_Name"))
				{
					Com_Para.Inf_Name = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "Inf_Name";
					tp.PARAM_VALUE = String.valueOf(Com_Para.Inf_Name);
				}else if(rs.getString("PARAM_KEY").equals("Child_Code"))
				{
					Com_Para.Child_Code = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					Com_Para.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
					tp.PARAM_KEY = "Child_Code";
					tp.PARAM_VALUE = String.valueOf(Com_Para.Child_Code);
				}else if(rs.getString("PARAM_KEY").equals("ServerIP"))
				{
					Com_Para.ServerIP = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "ServerIP";
					tp.PARAM_VALUE = String.valueOf(Com_Para.ServerIP);
				}else if(rs.getString("PARAM_KEY").equals("ServerPort"))
				{
					Com_Para.ServerPort = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "ServerPort";
					tp.PARAM_VALUE = String.valueOf(Com_Para.ServerPort);
				}else if(rs.getString("PARAM_KEY").equals("TimeCount"))
				{
					Com_Para.TimeCount = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "TimeCount";
					tp.PARAM_VALUE = String.valueOf(Com_Para.TimeCount);
				}else if(rs.getString("PARAM_KEY").equals("If_Child_Device"))
				{
					Com_Para.If_Child_Device = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "If_Child_Device";
					tp.PARAM_VALUE = String.valueOf(Com_Para.If_Child_Device);
				}else if(rs.getString("PARAM_KEY").equals("If_Parent_Device"))
				{
					Com_Para.If_Parent_Device = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "If_Parent_Device";
					tp.PARAM_VALUE = String.valueOf(Com_Para.If_Parent_Device);
				}else if(rs.getString("PARAM_KEY").equals("TimeCount"))
				{
					Com_Para.TimeCount = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "TimeCount";
					tp.PARAM_VALUE = String.valueOf(Com_Para.TimeCount);
				}else if(rs.getString("PARAM_KEY").equals("HTTP_Path"))
				{
					Com_Para.HTTP_Path = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "HTTP_Path";
					tp.PARAM_VALUE = String.valueOf(Com_Para.HTTP_Path);
				}else if(rs.getString("PARAM_KEY").equals("Login_Session"))
				{
					Com_Para.Login_Session = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "Login_Session";
					tp.PARAM_VALUE = String.valueOf(Com_Para.Login_Session);
				}else if(rs.getString("PARAM_KEY").equals("Is_UserLogin"))
				{
					Com_Para.Is_UserLogin = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "Is_UserLogin";
					tp.PARAM_VALUE = String.valueOf(Com_Para.Is_UserLogin);
				}else if(rs.getString("PARAM_KEY").equals("InterSession"))
				{
					// Com_Para.InterSession
					String temInterSession = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "InterSession";
					tp.PARAM_VALUE = temInterSession;
					Com_Para.htInterSession = new Hashtable<String, Integer>();
					for(String strIntS: temInterSession.split(","))
					{
						Com_Para.htInterSession.put(strIntS,1);
					}
				}else if(rs.getString("PARAM_KEY").equals("APP_ID"))
				{
					Com_Para.APP_ID = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "APP_ID";
					tp.PARAM_VALUE = String.valueOf(Com_Para.APP_ID);
				}else if(rs.getString("PARAM_KEY").equals("APP_PRIVATE_KEY"))
				{
					Com_Para.APP_PRIVATE_KEY = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "APP_PRIVATE_KEY";
					tp.PARAM_VALUE = String.valueOf(Com_Para.APP_PRIVATE_KEY);
				}else if(rs.getString("PARAM_KEY").equals("U_CODE"))
				{
					Com_Para.U_CODE = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "U_CODE";
					tp.PARAM_VALUE = String.valueOf(Com_Para.U_CODE);
				}else if(rs.getString("PARAM_KEY").equals("AliPay_Check"))
				{
					Com_Para.AliPay_Check = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "AliPay_Check";
					tp.PARAM_VALUE = String.valueOf(Com_Para.AliPay_Check);
				}else if(rs.getString("PARAM_KEY").equals("AliPay_Check2"))
				{
					Com_Para.AliPay_Check2 = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "AliPay_Check2";
					tp.PARAM_VALUE = String.valueOf(Com_Para.AliPay_Check2);
				}else if(rs.getString("PARAM_KEY").equals("WxPay_Check"))
				{
					Com_Para.WxPay_Check = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "WxPay_Check";
					tp.PARAM_VALUE = String.valueOf(Com_Para.WxPay_Check);
				}else if(rs.getString("PARAM_KEY").equals("Ali_Login"))
				{
					Com_Para.Ali_Login = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "Ali_Login";
					tp.PARAM_VALUE = String.valueOf(Com_Para.Ali_Login);
				}else if(rs.getString("PARAM_KEY").equals("SessionTimeOut"))
				{
					Com_Para.SessionTimeOut = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "SessionTimeOut";
					tp.PARAM_VALUE = String.valueOf(Com_Para.SessionTimeOut);
				}else if(rs.getString("PARAM_KEY").equals("ShowSqlError"))
				{
					Com_Para.ShowSqlError = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "ShowSqlError";
					tp.PARAM_VALUE = String.valueOf(Com_Para.ShowSqlError);
				}else if(rs.getString("PARAM_KEY").equals("strSessionAva"))
				{
					Com_Para.strSessionAva = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "strSessionAva";
					tp.PARAM_VALUE = String.valueOf(Com_Para.strSessionAva);
					bSessionAva = true;
				}else if(rs.getString("PARAM_KEY").equals("EncryptUtilType"))
				{
					Com_Para.EncryptUtilType = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "EncryptUtilType";
					tp.PARAM_VALUE = String.valueOf(Com_Para.EncryptUtilType);
				}else if(rs.getString("PARAM_KEY").equals("CustTimeTaskNum"))
				{
					Com_Para.CustTimeTaskNum = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "CustTimeTaskNum";
					tp.PARAM_VALUE = String.valueOf(Com_Para.CustTimeTaskNum);
				}else if(rs.getString("PARAM_KEY").equals("CustTimeREFLECT_IN_CLASS"))
				{
					Com_Para.CustTimeREFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "CustTimeREFLECT_IN_CLASS";
					tp.PARAM_VALUE = String.valueOf(Com_Para.CustTimeREFLECT_IN_CLASS);
				}else if(rs.getString("PARAM_KEY").equals("ServerREFLECT_IN_CLASS"))
				{
					Com_Para.ServerREFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "ServerREFLECT_IN_CLASS";
					tp.PARAM_VALUE = String.valueOf(Com_Para.ServerREFLECT_IN_CLASS);
				}else if(rs.getString("PARAM_KEY").equals("ClientREFLECT_IN_CLASS"))
				{
					Com_Para.ClientREFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "ClientREFLECT_IN_CLASS";
					tp.PARAM_VALUE = String.valueOf(Com_Para.ClientREFLECT_IN_CLASS);
				}else if(rs.getString("PARAM_KEY").equals("ServerWebPort"))
				{
					Com_Para.ServerWebPort = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "ServerWebPort";
					tp.PARAM_VALUE = String.valueOf(Com_Para.ServerWebPort);
				}else if(rs.getString("PARAM_KEY").equals("UpLoad_File"))
				{
					Com_Para.UpLoad_File = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "UpLoad_File";
					tp.PARAM_VALUE = String.valueOf(Com_Para.UpLoad_File);
				}else if(rs.getString("PARAM_KEY").equals("iReturnUppLower"))
				{
					Com_Para.iReturnUppLower = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "iReturnUppLower";
					tp.PARAM_VALUE = String.valueOf(Com_Para.iReturnUppLower);
				}else if(rs.getString("PARAM_KEY").equals("MQTT_host"))
				{
					Com_Para.MQTT_host = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "MQTT_host";
					tp.PARAM_VALUE = String.valueOf(Com_Para.MQTT_host);
				}else if(rs.getString("PARAM_KEY").equals("MQTT_username"))
				{
					Com_Para.MQTT_username = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "MQTT_username";
					tp.PARAM_VALUE = String.valueOf(Com_Para.MQTT_username);
				}else if(rs.getString("PARAM_KEY").equals("MQTT_pwd"))
				{
					Com_Para.MQTT_pwd = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "MQTT_pwd";
					tp.PARAM_VALUE = String.valueOf(Com_Para.MQTT_pwd);
				}else if(rs.getString("PARAM_KEY").equals("MQTT_topic_pull"))
				{
					Com_Para.MQTT_topic_pull = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "MQTT_topic_pull";
					tp.PARAM_VALUE = String.valueOf(Com_Para.MQTT_topic_pull);
				}else if(rs.getString("PARAM_KEY").equals("MQTT_topic_get"))
				{
					Com_Para.MQTT_topic_get = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "MQTT_topic_get";
					tp.PARAM_VALUE = String.valueOf(Com_Para.MQTT_topic_get);
				}else if(rs.getString("PARAM_KEY").equals("MQTTREFLECT_IN_CLASS"))
				{
					Com_Para.MQTTREFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "MQTTREFLECT_IN_CLASS";
					tp.PARAM_VALUE = String.valueOf(Com_Para.MQTTREFLECT_IN_CLASS);
				}else if(rs.getString("PARAM_KEY").equals("WebSocket_IN_CLASS"))
				{
					Com_Para.WebSocket_IN_CLASS = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
					tp.PARAM_KEY = "WebSocket_IN_CLASS";
					tp.PARAM_VALUE = String.valueOf(Com_Para.WebSocket_IN_CLASS);
				}else if(rs.getString("PARAM_KEY").equals("CachePowerControl"))
				{
					Com_Para.CachePowerControl = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "CachePowerControl";
					tp.PARAM_VALUE = String.valueOf(Com_Para.CachePowerControl);
				}
				else if(rs.getString("PARAM_KEY").equals("cdi_access_control_allow_methods")){
					Com_Para.cdi_access_control_allow_methods = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "cdi_access_control_allow_methods";
					tp.PARAM_VALUE = String.valueOf(Com_Para.cdi_access_control_allow_methods);
				}
				else if(rs.getString("PARAM_KEY").equals("single_login")){
					Com_Para.single_login = rs.getInt("PARAM_VALUE");
					tp.PARAM_KEY = "single_login";
					tp.PARAM_VALUE = String.valueOf(Com_Para.single_login);
				}
				else
				{
					tp.PARAM_KEY = Com_Fun.NoNull(rs.getString("PARAM_KEY"));
					tp.PARAM_VALUE = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
				}
				
				Com_Para.ht_T_PARAM_VALUE.put(tp.PARAM_KEY,tp.PARAM_VALUE);
			}
			if(Com_Para.Child_Code.equals(""))
			{
				Com_Para.Child_Code = Com_Fun.Get_New_GUID().replace("-","");
				strSql.delete(0,strSql.length());
				strSql.append("update t_param_value set PARAM_VALUE = '"
						+ Com_Para.Child_Code
						+ "' where PARAM_KEY = 'Child_Code'");
				db_self.CommonExec_Sql(strSql);
			}
			if(Com_Para.strSessionAva.equals(""))
			{
				Com_Para.strSessionAva = Com_Fun.setSconnections();
				strSql.delete(0,strSql.length());
				if(bSessionAva)
					strSql.append("update t_param_value set PARAM_VALUE = '"
							+ Com_Para.strSessionAva
							+ "' where PARAM_KEY = 'strSessionAva'");
				else
					strSql.append("insert into t_param_value(PARAM_KEY,PARAM_VALUE) values('strSessionAva','"
							+ Com_Para.strSessionAva + "')");
				db_self.CommonExec_Sql(strSql);
			}

			if(Com_Para.Child_Code.equals("2E71E37154914FA8A60A8BD72577F9F7")
					|| Com_Para.Child_Code.equals(""))
			{
				Com_Para.Child_Code = Com_Fun.Get_New_GUID().replace("-","");
				Change_Child_Code(Com_Para.Child_Code);
			}

			// 设置接口权限认证
			SetInterSession();
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			if(!java.util.Objects.equals(rs,null))
			{
				try
				{
					rs.getStatement().close();
					rs.close();
				}
				catch(SQLException e)
				{
				}
			}
		}
	}

	public void SetInterSession()
	{
		List<T_PROC_NAME> tpns = Get_T_PROC_NAME_LIST();
		for(T_PROC_NAME tpn: tpns)
		{
			if(tpn.IS_AUTHORITY != -1)
				Com_Para.htInterSession.put(tpn.INF_EN_NAME,tpn.IS_AUTHORITY);
		}
	}

	public Object Get_Db_Common(int DB_ID)
	{
		Object objResult = null;
		if(DB_ID == 1)
		{
			Db_Common1 dbc1 = new Db_Common1();
			objResult = dbc1;
		}else if(DB_ID == 2)
		{
			Db_Common2 dbc2 = new Db_Common2();
			objResult = dbc2;
		}else if(DB_ID == 3)
		{
			Db_Common3 dbc3 = new Db_Common3();
			objResult = dbc3;
		}else if(DB_ID == 4)
		{
			Db_Common4 dbc4 = new Db_Common4();
			objResult = dbc4;
		}else if(DB_ID == 5)
		{
			Db_Common5 dbc5 = new Db_Common5();
			objResult = dbc5;
		}else if(DB_ID == 6)
		{
			Db_Common6 dbc6 = new Db_Common6();
			objResult = dbc6;
		}else if(DB_ID == 7)
		{
			Db_Common7 dbc7 = new Db_Common7();
			objResult = dbc7;
		}else if(DB_ID == 8)
		{
			Db_Common8 dbc8 = new Db_Common8();
			objResult = dbc8;
		}else if(DB_ID == 9)
		{
			Db_Common9 dbc9 = new Db_Common9();
			objResult = dbc9;
		}else if(DB_ID == 10)
		{
			Db_Common10 dbc10 = new Db_Common10();
			objResult = dbc10;
		}
		return objResult;
	}

	public <T> T Obj_To_Db_Common(Object objIn)
	{
		Object objResult = null;
		Class<T> clz = null;
		if(objIn.toString().indexOf("com.zxy.db1.Db_Common1") == 0)
		{
			clz = (Class<T>) Db_Common1.class;
		}else if(objIn.toString().indexOf("com.zxy.db2.Db_Common2") == 0)
		{
			clz = (Class<T>) Db_Common2.class;
		}else if(objIn.toString().indexOf("com.zxy.db3.Db_Common3") == 0)
		{
			clz = (Class<T>) Db_Common3.class;
		}else if(objIn.toString().indexOf("com.zxy.db4.Db_Common4") == 0)
		{
			clz = (Class<T>) Db_Common4.class;
		}else if(objIn.toString().indexOf("com.zxy.db5.Db_Common5") == 0)
		{
			clz = (Class<T>) Db_Common5.class;
		}else if(objIn.toString().indexOf("com.zxy.db6.Db_Common6") == 0)
		{
			clz = (Class<T>) Db_Common6.class;
		}else if(objIn.toString().indexOf("com.zxy.db7.Db_Common7") == 0)
		{
			clz = (Class<T>) Db_Common7.class;
		}else if(objIn.toString().indexOf("com.zxy.db8.Db_Common8") == 0)
		{
			clz = (Class<T>) Db_Common8.class;
		}else if(objIn.toString().indexOf("com.zxy.db9.Db_Common9") == 0)
		{
			clz = (Class<T>) Db_Common9.class;
		}else if(objIn.toString().indexOf("com.zxy.db10.Db_Common10") == 0)
		{
			clz = (Class<T>) Db_Common10.class;
		}
		return clz.cast(objIn);
	}
		
	// Sql语句结果转JSON
	public JSONArray SqlToJson(int DB_ID, String inputStrSql)
	{
		StringBuilder strSql = new StringBuilder();
		strSql.append(inputStrSql);
		ResultSet rs = null;
		JSONArray jsAry = new JSONArray();
		try
		{
			Ope_DB_Cent odc = new Ope_DB_Cent();
			Object dbcobject = odc.Get_Db_Common(DB_ID);
			Db_Common_InterFace dbc = (Db_Common_InterFace) (odc.Obj_To_Db_Common(dbcobject));
			rs = dbc.Common_Sql(strSql);
			jsAry = Com_Fun.ResultSetToJSON(rs);
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			if(!java.util.Objects.equals(rs,null))
			{
				try
				{
					rs.getStatement().close();
					rs.close();
				}
				catch(SQLException e)
				{
				}
			}
		}
		return jsAry;
	}

	// Sql语句结果转JSON char字段需要url编码
	public JSONArray SqlToJsonCom(int DB_ID, String inputStrSql)
	{
		StringBuilder strSql = new StringBuilder();
		strSql.append(inputStrSql);
		ResultSet rs = null;
		JSONArray jsAry = new JSONArray();
		try
		{
			Ope_DB_Cent odc = new Ope_DB_Cent();
			Object dbcobject = odc.Get_Db_Common(DB_ID);
			Db_Common_InterFace dbc = (Db_Common_InterFace) (odc.Obj_To_Db_Common(dbcobject));
			rs = dbc.Common_Sql(strSql);
			jsAry = Com_Fun.ResultSetToJSONCom(rs);
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			if(!java.util.Objects.equals(rs,null))
			{
				try
				{
					rs.getStatement().close();
					rs.close();
				}
				catch(SQLException e)
				{
				}
			}
		}
		return jsAry;
	}
	
	public String Get_Seller_ID(String sales_order_title)
	{
		String strResult = "";
		StringBuilder strSql = new StringBuilder();
		strSql.append("select a.AliPay_Seller_ID from eova_user a "
				+ " left join t_sales_order b on a.id = b.SELLER_INT "
				+ " where b.SALES_ORDER_TITLE = '" + sales_order_title + "'");
		Db_Common_Self db_self = new Db_Common_Self();
		ResultSet rs = db_self.Common_Sql(strSql);
		try
		{
			while(rs.next())
			{
				strResult = rs.getString("AliPay_Seller_ID");
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			if(!java.util.Objects.equals(rs,null))
			{
				try
				{
					rs.getStatement().close();
					rs.close();
				}
				catch(SQLException e)
				{
				}
			}
		}
		return strResult;
	}

	public String Get_Child_Node(String param_name, String child_node)
	{
		String strResult = "-1";
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		StringBuilder strSql = new StringBuilder();
		strSql.append("select b.CHILD_NODE from t_child_proc a join t_child_node b "
				+ " on a.CHILD_ID = b.MAIN_ID where INF_EN_NAME = '"
				+ param_name + "' and b.CHILD_NODE = '" + child_node + "'");
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				strResult = rs.getString("CHILD_NODE");
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return strResult;
	}

	public List<T_DB_CONFIG> Get_T_DB_CONFIG(int i)
	{
		List<T_DB_CONFIG> td = new ArrayList<T_DB_CONFIG>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_db_config where MAIN_ID = '" + i + "'");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_DB_CONFIG tdc = new T_DB_CONFIG();
				tdc.setMAIN_ID(rs.getInt("MAIN_ID"));
				tdc.setDB_CN_NAME(Com_Fun.NoNull(rs.getString("db_cn_name")));
				tdc.setDB_DriverClassName(Com_Fun.NoNull(rs.getString("DB_driverClassName")));
				tdc.setDB_password(Com_Fun.NoNull(rs.getString("db_password")));
				tdc.setDB_url(Com_Fun.NoNull(rs.getString("db_url")));
				tdc.setDB_username(Com_Fun.NoNull(rs.getString("db_username")));
				tdc.setDB_version(Com_Fun.NoNull(rs.getString("db_version")));
				tdc.setDB_Code(Com_Fun.NoNull(rs.getString("db_code")));
				td.add(tdc);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public List<T_DB_CONFIG> Get_T_DB_CONFIG()
	{
		List<T_DB_CONFIG> td = new ArrayList<T_DB_CONFIG>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_db_config order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_DB_CONFIG tdc = new T_DB_CONFIG();
				tdc.setMAIN_ID(rs.getInt("MAIN_ID"));
				tdc.setDB_CN_NAME(Com_Fun.NoNull(rs.getString("db_cn_name")));
				tdc.setDB_DriverClassName(Com_Fun.NoNull(rs.getString("DB_driverClassName")));
				tdc.setDB_password(Com_Fun.NoNull(rs.getString("db_password")));
				tdc.setDB_url(Com_Fun.NoNull(rs.getString("db_url")));
				tdc.setDB_username(Com_Fun.NoNull(rs.getString("db_username")));
				tdc.setDB_version(Com_Fun.NoNull(rs.getString("db_version")));
				tdc.setDB_Code(Com_Fun.NoNull(rs.getString("db_code")));
				tdc.setS_DESC(Com_Fun.NoNull(rs.getString("s_desc")));
				td.add(tdc);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public String Get_RptSave_Path()
	{
		String strResult = "";
		StringBuilder strSql = new StringBuilder("select * from t_param_value where PARAM_KEY='RptSave'");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				strResult = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return strResult;
	}

	public String Get_RptTemp_Path()
	{
		String strResult = "";
		StringBuilder strSql = new StringBuilder("select * from t_param_value where PARAM_KEY='RptTemp'");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				strResult = Com_Fun.NoNull(rs.getString("PARAM_VALUE"));
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return strResult;
	}

	public T_PROC_NAME Get_T_PROC_NAME(String INF_EN_NAME)
	{
		T_PROC_NAME td = new T_PROC_NAME();
		StringBuilder strSql = new StringBuilder();
		if(!INF_EN_NAME.equals(""))
		{
			strSql.append("select * from T_PROC_NAME where INF_EN_NAME = '"
					+ INF_EN_NAME + "'");
		}else
			strSql.append("select * from t_proc_name");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.DB_ID = rs.getInt("DB_ID");
				td.INF_CN_NAME = Com_Fun.NoNull(rs.getString("INF_CN_NAME"));
				td.INF_EN_NAME = Com_Fun.NoNull(rs.getString("INF_EN_NAME"));
				td.INF_EN_SQL = Com_Fun.NoNull(rs.getString("INF_EN_SQL"));
				td.INF_TYPE = Com_Fun.NoNull(rs.getString("INF_TYPE"));
				td.REFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("REFLECT_IN_CLASS"));
				td.REFLECT_OUT_CLASS = Com_Fun.NoNull(rs.getString("REFLECT_OUT_CLASS"));
				td.IS_MOCK = rs.getInt("IS_MOCK");
				td.MOCK_DATA_COUNT = rs.getInt("MOCK_DATA_COUNT");
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public Hashtable<Integer, cal_variables> Get_cal_variables()
	{
		Hashtable<Integer, cal_variables> tds = new Hashtable<Integer, cal_variables>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from cal_variables");
		Db_Common1 dbc1 = new Db_Common1();
		ResultSet rs = null;
		try
		{
			rs = dbc1.Common_Sql(strSql);
			while(rs.next())
			{
				cal_variables td = new cal_variables();
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.VAR_NAME = Com_Fun.NoNull(rs.getString("VAR_NAME"));
				td.VAR_KEY = Com_Fun.NoNull(rs.getString("VAR_KEY"));
				td.VAR_TYPE = Com_Fun.NoNull(rs.getString("VAR_TYPE"));
				td.VAR_DESC = Com_Fun.NoNull(rs.getString("VAR_DESC"));
				td.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("1900-01-01 00:00:00")) : (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(rs.getString("CREATE_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				td.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
				tds.put(td.MAIN_ID,td);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public Hashtable<Integer, cal_fun> Get_cal_fun()
	{
		Hashtable<Integer, cal_fun> tds = new Hashtable<Integer, cal_fun>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from cal_fun");
		Db_Common1 dbc1 = new Db_Common1();
		ResultSet rs = null;
		try
		{
			rs = dbc1.Common_Sql(strSql);
			while(rs.next())
			{
				cal_fun td = new cal_fun();
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.FUN_NAME = Com_Fun.NoNull(rs.getString("FUN_NAME"));
				td.FUN_DESC = Com_Fun.NoNull(rs.getString("FUN_DESC"));
				td.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("1900-01-01 00:00:00")) : (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(rs.getString("CREATE_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				td.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
				tds.put(td.MAIN_ID,td);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public Hashtable<String, cal_run> Get_cal_run()
	{
		Hashtable<String, cal_run> tds = new Hashtable<String, cal_run>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from cal_run");
		Db_Common1 dbc1 = new Db_Common1();
		ResultSet rs = null;
		try
		{
			rs = dbc1.Common_Sql(strSql);
			while(rs.next())
			{
				cal_run td = new cal_run();
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.FUN_ID = rs.getInt("FUN_ID");
				td.RUN_CODE = Com_Fun.NoNull(rs.getString("RUN_CODE"));
				td.RUN_DESC = Com_Fun.NoNull(rs.getString("RUN_DESC"));
				td.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("1900-01-01 00:00:00")) : (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(rs.getString("CREATE_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				td.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
				tds.put(td.RUN_CODE,td);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<cal_run_param> Get_cal_run_param()
	{
		List<cal_run_param> tds = new ArrayList<cal_run_param>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from cal_run_param");
		Db_Common1 dbc1 = new Db_Common1();
		ResultSet rs = null;
		try
		{
			rs = dbc1.Common_Sql(strSql);
			while(rs.next())
			{
				cal_run_param td = new cal_run_param();
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.RUN_ID = rs.getInt("RUN_ID");
				td.VARI_ID = rs.getInt("VARI_ID");
				td.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("1900-01-01 00:00:00")) : (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(rs.getString("CREATE_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				td.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
				tds.add(td);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<cal_run_step> Get_cal_run_step()
	{
		List<cal_run_step> tds = new ArrayList<cal_run_step>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from cal_run_step");
		Db_Common1 dbc1 = new Db_Common1();
		ResultSet rs = null;
		try
		{
			rs = dbc1.Common_Sql(strSql);
			while(rs.next())
			{
				cal_run_step td = new cal_run_step();
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.CAL_STEP = Com_Fun.NoNull(rs.getString("CAL_STEP"));
				td.SETP_DESC = Com_Fun.NoNull(rs.getString("SETP_DESC"));
				td.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse("1900-01-01 00:00:00")) : (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(rs.getString("CREATE_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				td.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
				tds.add(td);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public T_PROC_NAME Get_T_PROC_NAME(String INF_EN_NAME, int SUB_ID)
	{
		T_PROC_NAME td = new T_PROC_NAME();
		StringBuilder strSql = new StringBuilder();
		if(!INF_EN_NAME.equals("") || SUB_ID != -1)
		{
			strSql.append("select * from T_PROC_NAME where INF_EN_NAME = '"
					+ INF_EN_NAME
					+ "' and MAIN_ID in (select PROC_ID from t_sub_power where SUB_ID = '"
					+ SUB_ID + "') order by s_sort,MAIN_ID asc");
		}else
			strSql.append("select * from t_proc_name");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.DB_ID = rs.getInt("DB_ID");
				td.INF_CN_NAME = Com_Fun.NoNull(rs.getString("INF_CN_NAME"));
				td.INF_EN_NAME = Com_Fun.NoNull(rs.getString("INF_EN_NAME"));
				td.INF_EN_SQL = Com_Fun.NoNull(rs.getString("INF_EN_SQL"));
				td.INF_TYPE = Com_Fun.NoNull(rs.getString("INF_TYPE"));
				td.REFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("REFLECT_IN_CLASS"));
				td.REFLECT_OUT_CLASS = Com_Fun.NoNull(rs.getString("REFLECT_OUT_CLASS"));
				td.IS_MOCK = rs.getInt("IS_MOCK");
				td.MOCK_DATA_COUNT = rs.getInt("MOCK_DATA_COUNT");
				break;
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public List<T_PROC_INPARAM> Get_T_PROC_INPARAM(int PROC_ID)
	{
		List<T_PROC_INPARAM> td = new ArrayList<T_PROC_INPARAM>();
		if(Com_Para.CachePowerControl == 1)
		{
			for(T_PROC_INPARAM tci: Com_Para.lst_T_PROC_INPARAM)
			{
				if(tci.PROC_ID == PROC_ID)
					td.add(tci);
			}
			return td;
		}
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_proc_inparam where PROC_ID = "
				+ PROC_ID+" order by s_sort,main_id asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_INPARAM tdc = new T_PROC_INPARAM();
				tdc.MAIN_ID = rs.getInt("MAIN_ID");
				tdc.PROC_ID = rs.getInt("PROC_ID");
				tdc.PARAM_CN_NAME = Com_Fun.NoNull(rs.getString("PARAM_CN_NAME"));
				tdc.PARAM_EN_NAME = Com_Fun.NoNull(rs.getString("PARAM_EN_NAME"));
				tdc.PARAM_TYPE = Com_Fun.NoNull(rs.getString("PARAM_TYPE"));
				tdc.PARAM_SIZE = rs.getInt("PARAM_SIZE");
				tdc.IS_URLENCODE = rs.getInt("IS_URLENCODE");
				td.add(tdc);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public List<T_PROC_OUTPARAM> Get_T_PROC_OUTPARAM(int PROC_ID)
	{
		List<T_PROC_OUTPARAM> td = new ArrayList<T_PROC_OUTPARAM>();
		if(Com_Para.CachePowerControl == 1)
		{
			for(T_PROC_OUTPARAM tci: Com_Para.lst_T_PROC_OUTPARAM)
			{
				if(tci.PROC_ID == PROC_ID)
					td.add(tci);
			}
			return td;
		}
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_proc_outparam where PROC_ID = "
				+ PROC_ID+" order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_OUTPARAM tdc = new T_PROC_OUTPARAM();
				tdc.MAIN_ID = rs.getInt("MAIN_ID");
				tdc.PROC_ID = rs.getInt("PROC_ID");
				tdc.PARAM_CN_NAME = Com_Fun.NoNull(rs.getString("PARAM_CN_NAME"));
				tdc.PARAM_EN_NAME = Com_Fun.NoNull(rs.getString("PARAM_EN_NAME"));
				tdc.PARAM_TYPE = Com_Fun.NoNull(rs.getString("PARAM_TYPE"));
				tdc.PARAM_SIZE = rs.getInt("PARAM_SIZE");
				td.add(tdc);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public List<T_PROC_RETURN> Get_T_PROC_RETURN(int PROC_ID)
	{
		List<T_PROC_RETURN> td = new ArrayList<T_PROC_RETURN>();
		if(Com_Para.CachePowerControl == 1)
		{
			for(T_PROC_RETURN tci: Com_Para.lst_T_PROC_RETURN)
			{
				if(tci.PROC_ID == PROC_ID)
					td.add(tci);
			}
			return td;
		}
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_proc_return where PROC_ID =" + PROC_ID+" order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_RETURN tdc = new T_PROC_RETURN();
				tdc.MAIN_ID = rs.getInt("MAIN_ID");
				tdc.PROC_ID = rs.getInt("PROC_ID");
				tdc.RETURN_NAME = Com_Fun.NoNull(rs.getString("RETURN_NAME"));
				tdc.RETURN_TYPE = Com_Fun.NoNull(rs.getString("RETURN_TYPE"));
				tdc.IS_IMG = rs.getInt("IS_IMG");
				if(!java.util.Objects.equals(rs.getObject("IS_URLENCODE"),null))
					tdc.IS_URLENCODE = rs.getInt("IS_URLENCODE");
				tdc.S_DESC = Com_Fun.NoNull(rs.getString("S_DESC"));
				tdc.MOCK_RUNCODE = Com_Fun.NoNull(rs.getString("MOCK_RUNCODE"));
				tdc.MOCK_VALUE = Com_Fun.NoNull(rs.getString("MOCK_VALUE"));
				tdc.MOCK_LENGTH = rs.getInt("MOCK_LENGTH");
				td.add(tdc);
			}
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException es)
			{
			}
		}
		return td;
	}

	public List<Oracle_Columns> Get_Oracle_Columns()
	{
		List<Oracle_Columns> td = new ArrayList<Oracle_Columns>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select a.TABLE_NAME,a.COLUMN_NAME,a.DATA_TYPE,t.CONSTRAINT_TYPE from user_tab_columns a left join (select b.table_name,b.column_name,c.constraint_type from user_cons_columns b join user_constraints c on c.CONSTRAINT_NAME=b.CONSTRAINT_NAME where c.constraint_type = 'P') t on a.table_name=t.table_name and a.column_name = t.column_name where (a.DATA_TYPE = 'VARCHAR2' or a.DATA_TYPE = 'CLOB') or t.constraint_type = 'P' order by a.TABLE_NAME");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				Oracle_Columns tdc = new Oracle_Columns();
				tdc.TABLE_NAME = Com_Fun.NoNull(rs.getString("TABLE_NAME"));
				tdc.COLUMN_NAME = Com_Fun.NoNull(rs.getString("COLUMN_NAME"));
				tdc.DATA_TYPE = Com_Fun.NoNull(rs.getString("DATA_TYPE"));
				tdc.CONSTRAINT_TYPE = Com_Fun.NoNull(rs.getString("CONSTRAINT_TYPE"));
				td.add(tdc);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return td;
	}

	public T_SUB_SYS Get_T_SUB_SYS(String SUB_CODE)
	{
		T_SUB_SYS tss = new T_SUB_SYS();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_sys where SUB_CODE ='" + SUB_CODE
				+ "' order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				tss.MAIN_ID = rs.getInt("MAIN_ID");
				tss.SUB_NAME = rs.getString("SUB_NAME");
				tss.SUB_CODE = rs.getString("SUB_CODE");
				if(!java.util.Objects.equals(rs.getObject("IP_ADDR"),null))
					tss.IP_ADDR = rs.getString("IP_ADDR");
				tss.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));
				break;
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tss;
	}

	public T_SUB_USERPOWER Get_T_SUB_USERPOWER(int sub_user_id, int proc_id)
	{
		T_SUB_USERPOWER tsp = new T_SUB_USERPOWER();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_userpower where SUB_USER_ID ='"
				+ sub_user_id + "' and PROC_ID = '" + proc_id + "'");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.SUB_USER_ID = rs.getInt("SUB_USER_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));// rs.getDate("LIMIT_DATE");
				tsp.USE_LIMIT = rs.getInt("USE_LIMIT");
				tsp.LIMIT_NUMBER = rs.getInt("LIMIT_NUMBER");
				tsp.LIMIT_TAG = rs.getString("LIMIT_TAG");
				tsp.FIRST_DATE = java.util.Objects.equals(rs.getDate("FIRST_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("FIRST_DATE")));// rs.getDate("FIRST_DATE");//rs.getDate("FIRST_DATE");
				tsp.S_DESC = rs.getString("S_DESC");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");//rs.getDate("CREATE_DATE");
				break;
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tsp;
	}

	public T_SUB_USER Get_T_SUB_USER(int sub_id, String sub_usercode)
	{
		T_SUB_USER tsp = new T_SUB_USER();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_user where SUB_USERCODE ='"
				+ sub_usercode + "' and SUB_ID = '" + sub_id + "'");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.SUB_ID = rs.getInt("SUB_ID");
				tsp.SUB_USERNAME = rs.getString("SUB_USERNAME");
				tsp.SUB_USERCODE = rs.getString("SUB_USERCODE");
				tsp.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				tsp.S_DESC = rs.getString("S_DESC");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");
				break;
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tsp;
	}

	public T_SUB_POWER Get_T_SUB_POWER(int SUB_ID, int PROC_ID)
	{
		T_SUB_POWER tsp = new T_SUB_POWER();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_power where SUB_ID ='" + SUB_ID
				+ "' and PROC_ID = '" + PROC_ID + "'");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.SUB_ID = rs.getInt("SUB_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));// rs.getDate("LIMIT_DATE");
				tsp.USE_LIMIT = rs.getInt("USE_LIMIT");
				tsp.LIMIT_NUMBER = rs.getInt("LIMIT_NUMBER");
				tsp.LIMIT_TAG = rs.getString("LIMIT_TAG");
				tsp.FIRST_DATE = java.util.Objects.equals(rs.getDate("FIRST_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("FIRST_DATE"))); // rs.getDate("FIRST_DATE"));//rs.getDate("FIRST_DATE");
				tsp.S_DESC = rs.getString("S_DESC");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE"))); // rs.getDate("CREATE_DATE"));//rs.getDate("FIRST_DATE");
				break;
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tsp;
	}

	public List<T_SUB_SYS> Get_T_SUB_SYS_LIST()
	{
		List<T_SUB_SYS> tds = new ArrayList<T_SUB_SYS>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_sys order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_SUB_SYS tss = new T_SUB_SYS();
				tss.MAIN_ID = rs.getInt("MAIN_ID");
				tss.SUB_NAME = rs.getString("SUB_NAME");
				tss.SUB_CODE = rs.getString("SUB_CODE");
				if(!java.util.Objects.equals(rs.getObject("IP_ADDR"),null))
					tss.IP_ADDR = rs.getString("IP_ADDR");
				tss.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));
				tds.add(tss);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_PROC_RETURN> Get_T_PROC_RETURN_LIST()
	{
		List<T_PROC_RETURN> tds = new ArrayList<T_PROC_RETURN>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from T_PROC_RETURN order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_RETURN tsp = new T_PROC_RETURN();
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.RETURN_NAME = rs.getString("RETURN_NAME");
				tsp.RETURN_TYPE = rs.getString("RETURN_TYPE");
				tsp.MOCK_RUNCODE = rs.getString("MOCK_RUNCODE");
				tsp.MOCK_VALUE = rs.getString("MOCK_VALUE");
				tsp.IS_IMG = rs.getInt("IS_IMG");
				tsp.IS_URLENCODE = rs.getInt("IS_URLENCODE");
				tsp.LIST_HIDDEN = rs.getInt("LIST_HIDDEN");
				tsp.MOCK_LENGTH = rs.getInt("MOCK_LENGTH");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");//rs.getDate("CREATE_DATE");
				tds.add(tsp);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_PROC_OUTPARAM> Get_T_PROC_OUTPARAM_LIST()
	{
		List<T_PROC_OUTPARAM> tds = new ArrayList<T_PROC_OUTPARAM>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from T_PROC_OUTPARAM order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_OUTPARAM tsp = new T_PROC_OUTPARAM();
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.PARAM_CN_NAME = rs.getString("PARAM_CN_NAME");
				tsp.PARAM_EN_NAME = rs.getString("PARAM_EN_NAME");
				tsp.PARAM_TYPE = rs.getString("PARAM_TYPE");
				tsp.PARAM_SIZE = rs.getInt("PARAM_SIZE");
				tsp.IS_IMG = rs.getInt("IS_IMG");
				tsp.IS_URLENCODE = rs.getInt("IS_URLENCODE");
				tsp.LIST_HIDDEN = rs.getInt("LIST_HIDDEN");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");//rs.getDate("CREATE_DATE");
				tds.add(tsp);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_PROC_INPARAM> Get_T_PROC_INPARAM_LIST()
	{
		List<T_PROC_INPARAM> tds = new ArrayList<T_PROC_INPARAM>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from T_PROC_INPARAM order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_INPARAM tsp = new T_PROC_INPARAM();
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.PARAM_CN_NAME = rs.getString("PARAM_CN_NAME");
				tsp.PARAM_EN_NAME = rs.getString("PARAM_EN_NAME");
				tsp.PARAM_TYPE = rs.getString("PARAM_TYPE");
				tsp.PARAM_SIZE = rs.getInt("PARAM_SIZE");
				tsp.IS_URLENCODE = rs.getInt("IS_URLENCODE");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");//rs.getDate("CREATE_DATE");
				tds.add(tsp);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_SUB_USERPOWER> Get_T_SUB_USERPOWER_LIST()
	{
		List<T_SUB_USERPOWER> tds = new ArrayList<T_SUB_USERPOWER>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_userpower order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_SUB_USERPOWER tsp = new T_SUB_USERPOWER();
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.SUB_USER_ID = rs.getInt("SUB_USER_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));// rs.getDate("LIMIT_DATE");
				tsp.USE_LIMIT = rs.getInt("USE_LIMIT");
				tsp.LIMIT_NUMBER = rs.getInt("LIMIT_NUMBER");
				tsp.LIMIT_TAG = rs.getString("LIMIT_TAG");
				tsp.FIRST_DATE = java.util.Objects.equals(rs.getDate("FIRST_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("FIRST_DATE")));// rs.getDate("FIRST_DATE");//rs.getDate("FIRST_DATE");
				tsp.S_DESC = rs.getString("S_DESC");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");//rs.getDate("CREATE_DATE");
				tds.add(tsp);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_SUB_USER> Get_T_SUB_USER_LIST()
	{
		List<T_SUB_USER> tds = new ArrayList<T_SUB_USER>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_user order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_SUB_USER tsp = new T_SUB_USER();
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.SUB_ID = rs.getInt("SUB_ID");
				tsp.SUB_USERNAME = rs.getString("SUB_USERNAME");
				tsp.SUB_USERCODE = rs.getString("SUB_USERCODE");
				tsp.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));// rs.getDate("LIMIT_DATE");//rs.getDate("LIMIT_DATE");
				tsp.S_DESC = rs.getString("S_DESC");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE")));// rs.getDate("CREATE_DATE");
				tds.add(tsp);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_SUB_POWER> Get_T_SUB_POWER_LIST()
	{
		List<T_SUB_POWER> tds = new ArrayList<T_SUB_POWER>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_sub_power order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_SUB_POWER tsp = new T_SUB_POWER();
				tsp.MAIN_ID = rs.getInt("MAIN_ID");
				tsp.SUB_ID = rs.getInt("SUB_ID");
				tsp.PROC_ID = rs.getInt("PROC_ID");
				tsp.LIMIT_DATE = java.util.Objects.equals(rs.getDate("LIMIT_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("LIMIT_DATE")));// rs.getDate("LIMIT_DATE");
				tsp.USE_LIMIT = rs.getInt("USE_LIMIT");
				tsp.LIMIT_NUMBER = rs.getInt("LIMIT_NUMBER");
				tsp.LIMIT_TAG = rs.getString("LIMIT_TAG");
				tsp.FIRST_DATE = java.util.Objects.equals(rs.getDate("FIRST_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("FIRST_DATE"))); // rs.getDate("FIRST_DATE"));//rs.getDate("FIRST_DATE");
				tsp.S_DESC = rs.getString("S_DESC");
				tsp.CREATE_DATE = java.util.Objects.equals(rs.getDate("CREATE_DATE"),null) ? (new SimpleDateFormat("yyyy-MM-dd").parse("1900-1-1")) : (new SimpleDateFormat("yyyy-MM-dd").parse(rs.getString("CREATE_DATE"))); // rs.getDate("CREATE_DATE"));//rs.getDate("FIRST_DATE");
				tds.add(tsp);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	public List<T_PROC_NAME> Get_T_PROC_NAME_LIST()
	{
		List<T_PROC_NAME> tds = new ArrayList<T_PROC_NAME>();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_proc_name order by s_sort,MAIN_ID asc");
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				T_PROC_NAME td = new T_PROC_NAME();
				td.MAIN_ID = rs.getInt("MAIN_ID");
				td.DB_ID = rs.getInt("DB_ID");
				td.INF_CN_NAME = Com_Fun.NoNull(rs.getString("INF_CN_NAME"));
				td.INF_EN_NAME = Com_Fun.NoNull(rs.getString("INF_EN_NAME"));
				td.INF_EN_SQL = Com_Fun.NoNull(rs.getString("INF_EN_SQL"));
				td.INF_TYPE = Com_Fun.NoNull(rs.getString("INF_TYPE"));
				td.REFLECT_IN_CLASS = Com_Fun.NoNull(rs.getString("REFLECT_IN_CLASS"));
				td.REFLECT_OUT_CLASS = Com_Fun.NoNull(rs.getString("REFLECT_OUT_CLASS"));
				td.IS_MOCK = rs.getInt("IS_MOCK");
				td.MOCK_DATA_COUNT = rs.getInt("MOCK_DATA_COUNT");
				try
				{
					if(rs.findColumn("IS_AUTHORITY") >= 0)
					{
						td.IS_AUTHORITY = rs.getInt("IS_AUTHORITY");
					}
				}
				catch(Exception set)
				{

				}
				tds.add(td);
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return tds;
	}

	private void Change_Child_Code(String Child_Code)
	{
		Db_Common_Self dbc_ic = new Db_Common_Self();
		StringBuilder strSql = new StringBuilder();
		strSql.append("select * from t_param_value where PARAM_KEY = 'Child_Code' order by s_sort,MAIN_ID asc");
		ResultSet rs = dbc_ic.Common_Sql(strSql);
		try
		{
			boolean bFlag = false;
			while(rs.next())
			{
				bFlag = true;
				break;
			}
			strSql.delete(0,strSql.length());
			if(bFlag)
			{
				strSql.append("update t_param_value set PARAM_VALUE='"
						+ Child_Code + "' where PARAM_KEY = 'Child_Code'");
			}else
			{
				strSql.append("insert into t_param_value(PARAM_KEY,PARAM_VALUE,PARAM_NAME,S_DESC,CREATE_DATE) "
						+ " values('Child_Code','" + Child_Code
						+ "','本设备唯一编码','',"
						+ Oracle_Str_To_Date(dbc_ic.conn_a.connection,new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()))
						+ ");");
			}
			dbc_ic.CommonExec_Sql(strSql);
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
	}

	/************************************/
	private List<Integer> Get_MAIN(StringBuilder strSql)
	{
		List<Integer> liMainID = new ArrayList<Integer>();
		Db_Common_Self dbc_ic = new Db_Common_Self();
		ResultSet rs = null;
		try
		{
			rs = dbc_ic.Common_Sql(strSql);
			while(rs.next())
			{
				liMainID.add(rs.getInt("MAIN_ID"));
			}
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return liMainID;
	}

	public void InitData()
	{
		String[] strSubTable =
		{ "t_proc_name" };
		StringBuilder strSql = new StringBuilder("select * from t_db_config order by s_sort, cast(MAIN_ID as int)");
		Ope_InitData("t_db_config",strSubTable,"DB_ID",strSql);

		String[] strSubTable1 =
		{ "t_proc_inparam", "t_proc_outparam", "t_proc_return", "t_sub_power",
				"t_sub_userpower", "t_proc_log", "t_page_item" };
		strSql.delete(0,strSql.length());
		strSql.append("select * from t_proc_name order by cast(DB_ID as int), s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_proc_name",strSubTable1,"PROC_ID",strSql);

		strSubTable = new String[0];
		strSql.delete(0,strSql.length());
		strSql.append("select * from t_proc_inparam order by cast(PROC_ID as int), s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_proc_inparam",strSubTable,"PROC_ID",strSql);

		strSql.delete(0,strSql.length());
		strSql.append("select * from t_proc_outparam order by cast(PROC_ID as int), s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_proc_outparam",strSubTable,"PROC_ID",strSql);

		strSql.delete(0,strSql.length());
		strSql.append("select * from t_proc_return order by cast(PROC_ID as int), s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_proc_return",strSubTable,"PROC_ID",strSql);

		strSql.delete(0,strSql.length());
		strSql.append("select * from t_sub_power order by cast(PROC_ID as int), s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_sub_power",strSubTable,"PROC_ID",strSql);

		strSql.delete(0,strSql.length());
		strSql.append("select * from t_sub_userpower order by cast(PROC_ID as int), s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_sub_userpower",strSubTable,"PROC_ID",strSql);

		strSql.delete(0,strSql.length());
		strSql.append("select * from t_proc_log order by  s_sort,cast(MAIN_ID as int)");
		Ope_InitData("t_proc_log",strSubTable,"PROC_ID",strSql);
		System.out.println("over");
	}

	private boolean Ope_InitData(String strParTable, String[] strSubTable, String strSubPID, StringBuilder strSelPID)
	{
		boolean bResult = true;
		Db_Common_Self dbc_ic = new Db_Common_Self();
		StringBuilder strSql = new StringBuilder();
		strSql.append("update " + strParTable
				+ " set MAIN_ID = MAIN_ID + 1000 where MAIN_ID < 1000");
		dbc_ic.CommonExec_Sql(strSql);
		System.out.println("upd父表:" + strSql);
		for(String strtb_name: strSubTable)
		{
			strSql.delete(0,strSql.length());
			strSql.append("update " + strtb_name + " set " + strSubPID + "="
					+ strSubPID + "+1000 where " + strSubPID + " < 1000");
			dbc_ic.CommonExec_Sql(strSql);
		}

		List<Integer> liMainID = Get_MAIN(strSelPID);
		int i = 0;
		for(int iMAIN_ID: liMainID)
		{
			i++;
			strSql.delete(0,strSql.length());
			strSql.append("update " + strParTable + " set MAIN_ID = " + i
					+ " where MAIN_ID = " + iMAIN_ID);
			PooledConnection_Self conn = null;
			try
			{
				conn = dbc_ic.BeginTransaction();
				dbc_ic.CommonExec_Sql(conn,strSql);
				System.out.println("sql父表:" + strSql);
				StringBuilder strSql1 = new StringBuilder();
				for(String strtb_name: strSubTable)
				{
					strSql1.delete(0,strSql1.length());
					strSql1.append("update " + strtb_name + " set " + strSubPID
							+ "=" + i + " where " + strSubPID + "=" + iMAIN_ID);
					System.out.println("sql子表:" + strSql1);
					dbc_ic.CommonExec_Sql(conn,strSql1);
				}
				conn.CommitTranSaction();
			}
			catch(SQLException e)
			{
				Com_Fun.debug_in(e,this.toString());
				bResult = false;
				try
				{
					conn.RollBackTranSaction();
				}
				catch(SQLException e1)
				{
				}
			}
			finally
			{
				conn.returnConnection();
			}
		}
		return bResult;
	}

	// 判断接口是否重复
	public String get_t_proc_name_id(String temproc_name)
	{
		Db_Common_Self dbcs = new Db_Common_Self();
		String strSql = "select * from t_proc_name where inf_en_name = '"
				+ temproc_name + "'";
		ResultSet rs = null;
		try
		{
			rs = dbcs.Common_Sql(new StringBuilder(strSql));
			while(rs.next())
			{
				return rs.getString("MAIN_ID");
			}
			return "";
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
			return "";
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
	}

	// oracle 字符转时间
	private String Oracle_Str_To_Date(java.sql.Connection conn, String strInput)
	{
		if(conn.getClass().toString().indexOf("oracle") != -1)
			return " to_date('" + strInput + "','yyyy-mm-dd hh24:mi:ss') ";
		else
			return " '" + strInput + "' ";

	}

	// oracle 时间转字符
	private String Oracle_Date_To_Str(java.sql.Connection conn, String strInput)
	{
		if(conn.getClass().toString().indexOf("oracle") != -1)
			return " to_char('yyyy-mm-dd hh24:mi:ss','" + strInput + "') ";
		else
			return " '" + strInput + "' ";
	}

	// JSON对象数据入库,包含主表PID信息
	public void Ins_TABLE_Data_JSON(JSONObject inputjsob, String inputTable_name, String DB_ID,String[] PID_key,String[] PID_value)
	{
		String temSqlIns = "insert into " + inputTable_name + "(";
		String temstrSqlValues = " values(";
		int iIndex = 0;

		StringBuilder sqlException = null;
		PooledConnection_InterFace pi = null;
		Db_Common_InterFace dbc = null;
		Ope_DB_Cent odc = new Ope_DB_Cent();
		ResultSet rs = null;
		try
		{
			@SuppressWarnings("unchecked")
			Iterator<String> itkeysSize = inputjsob.keys();
			int iLength = 0;
			while(itkeysSize.hasNext())
			{
				String key = itkeysSize.next();
				if(!key.toLowerCase().equals("main_id"))
					iLength++;
			}
			String[] temParameters = new String[iLength];
			String[] temParamTypes = new String[iLength];

			@SuppressWarnings("unchecked")
			Iterator<String> itkeys = inputjsob.keys();
			while(itkeys.hasNext())
			{
				String key = itkeys.next();
				int itemIndex = 0;
				for(String strK : PID_key){
					if(java.util.Objects.equals(key.toLowerCase(),strK.toLowerCase()))
						inputjsob.put(key,PID_value[itemIndex]);
					itemIndex ++;
				}
				String temvalue = inputjsob.getString(key);
				if(!key.toLowerCase().equals("main_id"))
				{
					if(java.util.Objects.equals(temvalue,null))
						temvalue = "";
					else if(temvalue.toLowerCase().equals("none"))
						temvalue = "";
					if(iIndex == 0)
					{
						temSqlIns += key.toLowerCase();
						temstrSqlValues += "?";
					}else
					{
						temSqlIns = temSqlIns + "," + key.toLowerCase();
						temstrSqlValues = temstrSqlValues + ",?";
					}
					temParameters[iIndex] = temvalue;
					temParamTypes[iIndex] = "STRING";
					iIndex++;
				}
			}

			Object dbcobject = odc.Get_Db_Common(Integer.valueOf(DB_ID));
			dbc = (Db_Common_InterFace) (odc.Obj_To_Db_Common(dbcobject));
			String[] temParamOutName = new String[0];
			String[] temParamOutType = new String[0];
			com.zxy.model.T_PROC_NAME trn = new com.zxy.model.T_PROC_NAME();
			trn.INF_TYPE = "2"; // Sql
			trn.INF_EN_SQL = temSqlIns + ") " + temstrSqlValues + ")";
			rs = dbc.Common_Sql_Proc(inputTable_name,temParameters,temParamTypes,temParamOutName,temParamOutType,trn);
			sqlException = dbc.getSqlException();
			pi = (PooledConnection_InterFace) dbc.getConn_a();
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
				if(!java.util.Objects.equals(dbc,null) && !pi.isB_nocursor())
				{
					if(!java.util.Objects.equals(pi,null)
							&& !java.util.Objects.equals(pi.getCalls(),null))
						pi.getCalls().close();
				}else if(!java.util.Objects.equals(dbc,null))
				{
					pi.returnConnection();
				}
			}
			catch(Exception e)
			{
			}
		}
	}
	
	// JSON对象数据入库 静态配置库
	public void Ins_Data_JSON(JSONObject inputjsob, String inputTable_name, String inputPROC_ID)
	{
		String temSqlIns = "insert into " + inputTable_name + "(";
		String temstrSqlValues = " values(";
		int iIndex = 0;
		ResultSet rs = null;
		try
		{
			@SuppressWarnings("unchecked")
			Iterator<String> itkeysSize = inputjsob.keys();
			int iLength = 0;
			while(itkeysSize.hasNext())
			{
				String key = itkeysSize.next();
				if(!key.toLowerCase().equals("main_id"))
					iLength++;
			}
			String[] temParameters = new String[iLength];
			String[] temParamTypes = new String[iLength];

			@SuppressWarnings("unchecked")
			Iterator<String> itkeys = inputjsob.keys();
			while(itkeys.hasNext())
			{
				String key = itkeys.next();
				String temvalue = inputjsob.getString(key);
				if(!key.toLowerCase().equals("main_id"))
				{
					if(key.toLowerCase().equals("proc_id"))
						temvalue = inputPROC_ID;
					else if(java.util.Objects.equals(temvalue,null))
						temvalue = "";
					else if(temvalue.toLowerCase().equals("none"))
						temvalue = "";
					if(iIndex == 0)
					{
						temSqlIns += key.toLowerCase();
						temstrSqlValues += "?";
					}else
					{
						temSqlIns = temSqlIns + "," + key.toLowerCase();
						temstrSqlValues = temstrSqlValues + ",?";
					}
					temParameters[iIndex] = temvalue;
					temParamTypes[iIndex] = "STRING";
					iIndex++;
				}
			}

			Db_Common1 dbc1 = new Db_Common1();
			String ProName = inputTable_name;// Sql
			String[] temParamOutName = new String[0];
			String[] temParamOutType = new String[0];
			com.zxy.model.T_PROC_NAME trn = new com.zxy.model.T_PROC_NAME();
			trn.INF_TYPE = "2"; // Sql
			trn.INF_EN_SQL = temSqlIns + ") " + temstrSqlValues + ")";
			rs = dbc1.Common_Sql_Proc(ProName,temParameters,temParamTypes,temParamOutName,temParamOutType,trn);
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
	}

	// 根据sql语句判断记录是否存在
	public boolean Had_Data_By_Sql(String strSql,String[] temParameters,String[] temParamTypes, String DB_ID)
	{
		boolean bResult = false;
		ResultSet rs = null;
		StringBuilder sqlException = null;
		PooledConnection_InterFace pi = null;
		Db_Common_InterFace dbc = null;
		Ope_DB_Cent odc = new Ope_DB_Cent();
		try
		{
			Object dbcobject = odc.Get_Db_Common(Integer.valueOf(DB_ID));
			dbc = (Db_Common_InterFace) (odc.Obj_To_Db_Common(dbcobject));
			String[] temParamOutName = new String[0];
			String[] temParamOutType = new String[0];
			com.zxy.model.T_PROC_NAME trn = new com.zxy.model.T_PROC_NAME();
			trn.INF_TYPE = "2"; // Sql
			trn.INF_EN_SQL = strSql;
			rs = dbc.Common_Sql_Proc("find_data",temParameters,temParamTypes,temParamOutName,temParamOutType,trn);
			sqlException = dbc.getSqlException();
			pi = (PooledConnection_InterFace) dbc.getConn_a();
			
			while(rs.next()){
				bResult = true;
				break;
			}
		}
		catch(Exception e)
		{
			bResult = false;
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
				if(!java.util.Objects.equals(dbc,null) && !pi.isB_nocursor())
				{
					if(!java.util.Objects.equals(pi,null)
							&& !java.util.Objects.equals(pi.getCalls(),null))
						pi.getCalls().close();
				}else if(!java.util.Objects.equals(dbc,null))
				{
					pi.returnConnection();
				}
			}
			catch(Exception e)
			{
			}
		}
		return bResult;
	}
	
	/******************************/
	public boolean Ope_Data_Number(T_SUB_POWER tsp, T_SUB_USERPOWER tsup, int proc_id)
	{
		boolean bResult = true;
		Db_Common_Self dbc_ic = new Db_Common_Self();
		StringBuilder strSql = new StringBuilder();
		PooledConnection_Self conn = null;
		ResultSet rs = null;
		try
		{
			conn = dbc_ic.BeginTransaction();
			if(tsup.MAIN_ID != -1)
			{
				String strForatS = "yyyy-MM-dd";
				if(tsup.LIMIT_TAG.equals("1"))
					strForatS = "yyyy";
				else if(tsup.LIMIT_TAG.equals("2"))
					strForatS = "yyyy-MM";
				if(tsup.LIMIT_TAG.equals("3"))
					strForatS = "yyyy-MM-dd";

				if(new SimpleDateFormat(strForatS).format(new Date()).equals(new SimpleDateFormat(strForatS).format(tsup.FIRST_DATE)))
				{
					strSql.append("update t_sub_userpower set USE_LIMIT = USE_LIMIT + 1 where MAIN_ID = '"
							+ tsup.MAIN_ID + "'");
				}else
				{
					strSql.append("update t_sub_userpower set USE_LIMIT = 1,FIRST_DATE = "
							+ Oracle_Str_To_Date(conn.connection,new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()))
							+ " where MAIN_ID = '" + tsup.MAIN_ID + "'");
				}
				dbc_ic.CommonExec_Sql(conn,strSql);
			}
			String strDtDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
			if(tsup.MAIN_ID == -1 && tsp.MAIN_ID != -1)
			{
				String strForatS = "yyyy-MM-dd";
				if(tsup.LIMIT_TAG.equals("1"))
					strForatS = "yyyy";
				else if(tsup.LIMIT_TAG.equals("2"))
					strForatS = "yyyy-MM";
				if(tsup.LIMIT_TAG.equals("3"))
					strForatS = "yyyy-MM-dd";
				strSql.delete(0,strSql.length());
				if(new SimpleDateFormat(strForatS).format(new Date()).equals(new SimpleDateFormat(strForatS).format(tsp.FIRST_DATE)))
				{
					strSql.append("update t_sub_power set USE_LIMIT = USE_LIMIT + 1 where MAIN_ID = '"
							+ tsp.MAIN_ID + "'");
				}else
				{
					strSql.append("update t_sub_power set USE_LIMIT = 1,FIRST_DATE = "
							+ Oracle_Str_To_Date(conn.connection,strDtDate)
							+ " where MAIN_ID = '" + tsp.MAIN_ID + "'");
				}
				dbc_ic.CommonExec_Sql(conn,strSql);
			}
			strSql.delete(0,strSql.length());
			strSql.append("select * from t_proc_log where SUB_USER_ID = '"
					+ tsup.SUB_USER_ID + "'  and PROC_ID = '" + proc_id
					+ "' and SYS_DATE = "
					+ Oracle_Str_To_Date(conn.connection,strDtDate));
			rs = dbc_ic.Common_Sql(conn,strSql);

			boolean bFlag = false;
			while(rs.next())
			{
				bFlag = true;
				break;
			}
			strSql.delete(0,strSql.length());
			if(bFlag)
			{
				strSql.append("update t_proc_log set S_COUNT = S_COUNT+1 where SUB_USER_ID = '"
						+ tsup.SUB_USER_ID + "'  and PROC_ID = '" + proc_id
						+ "' and SYS_DATE = "
						+ Oracle_Str_To_Date(conn.connection,strDtDate));
			}else
			{
				strSql.append("insert into t_proc_log(SUB_USER_ID,PROC_ID,S_COUNT,SYS_DATE,S_DESC,CREATE_DATE) "
						+ " values('" + tsup.SUB_USER_ID + "','" + proc_id
						+ "','1',"
						+ Oracle_Str_To_Date(conn.connection,strDtDate) + ",'',"
						+ Oracle_Str_To_Date(conn.connection,strDtDate) + ")");
			}
			dbc_ic.CommonExec_Sql(conn,strSql);
			conn.CommitTranSaction();
		}
		catch(SQLException e)
		{
			Com_Fun.debug_in(e,this.toString());
			bResult = false;
			try
			{
				conn.RollBackTranSaction();
			}
			catch(SQLException e1)
			{
			}
		}
		finally
		{
			try
			{
				conn.returnConnection();
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e1)
			{
			}
		}
		return bResult;
	}

	private StringBuilder Run_Sql_ByDB(int DB_ID, StringBuilder inputStrSql)
	{
		StringBuilder strResult = new StringBuilder();
		try
		{
			Object dbcobject = this.Get_Db_Common(DB_ID);
			Db_Common_InterFace dbc = (Db_Common_InterFace) (this.Obj_To_Db_Common(dbcobject));
			dbc.CommonExec_Sql(inputStrSql);
			strResult = dbc.getSqlException();
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		return strResult;
	}

	// 根据DB_ID获取表信息
	private JSONArray Get_mysql_table_info_ByDB(String inputTABLE_NAME, String DB_ID)
	{
		// 执行数据库操作
		ResultSet rs = null;
		StringBuilder sqlException = null;
		PooledConnection_InterFace pi = null;
		Db_Common_InterFace dbc = null;
		StringBuilder inputStrSql = new StringBuilder();
		JSONArray jsoAry = null;

		try
		{
			inputStrSql.append("SELECT '-1' as 'MAIN_ID','' as COLUMN_CN_NAME,COLUMN_NAME as 'COLUMN_EN_NAME',DATA_TYPE as 'COLUMN_TYPE' "
					+ " FROM information_schema.`COLUMNS` where TABLE_NAME = '"
					+ inputTABLE_NAME + "'");
			String db_name = "";
			// 根据不同数据源获取通用数据库调用方法
			Ope_DB_Cent odc = new Ope_DB_Cent();
			Object dbcobject = odc.Get_Db_Common(Integer.valueOf(DB_ID));
			dbc = (Db_Common_InterFace) (odc.Obj_To_Db_Common(dbcobject));
			rs = dbc.Common_Sql(new StringBuilder("select 1 from dual"));
			pi = (PooledConnection_InterFace) dbc.getConn_a();
			db_name = pi.getConnection().getCatalog();

			inputStrSql.append("and TABLE_SCHEMA = '" + db_name + "';");
			rs = dbc.Common_Sql(inputStrSql);
			sqlException = dbc.getSqlException();
			jsoAry = Com_Fun.ResultSetToJSON(rs);
		}
		catch(Exception e)
		{
			Com_Fun.debug_in(e,this.toString());
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
				if(!java.util.Objects.equals(dbc,null) && !pi.isB_nocursor())
				{
					if(!java.util.Objects.equals(pi,null)
							&& !java.util.Objects.equals(pi.getCalls(),null))
						pi.getCalls().close();
				}else if(!java.util.Objects.equals(dbc,null))
				{
					pi.returnConnection();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return jsoAry;
	}

	//创建树型表查询函数mysql
	public StringBuilder Create_funnode(String inputDB_ID, String inputTABLE_NAME,JSONObject t_single_expand) throws JSONException{
		StringBuilder strResult = new StringBuilder();
		if(t_single_expand.length() != 0){
			StringBuilder temSql = new StringBuilder();
			temSql.append("CREATE FUNCTION `funnode_"+inputTABLE_NAME+"`(in_pid varchar(500)) RETURNS varchar(2000) ");
			temSql.append("\r\nbegin");
			temSql.append("\r\n	/*树形结构数据查询*/");
			temSql.append("\r\n	declare str varchar(1000);");
			temSql.append("\r\n	declare cid varchar(1000);");
			temSql.append("\r\n	set str = ' ';");
			temSql.append("\r\n	set cid = in_pid;");
			temSql.append("\r\n	while cid is not null do");
			temSql.append("\r\n		set str = concat(str,',',cid);");
			temSql.append("\r\n    	select group_concat("+t_single_expand.getString("C_NODE")+") into cid from "+inputTABLE_NAME+" where find_in_set("+t_single_expand.getString("P_NODE")+",cid) > 0 or PT_CODE = cid;");
			temSql.append("\r\n	end while;");
			temSql.append("\r\n	set str = substring(str,2);");
			temSql.append("\r\n	return str;");
			temSql.append("\r\nend");
			strResult = this.Run_Sql_ByDB(Integer.valueOf(inputDB_ID),temSql);
		}
		return strResult;
	}
	
	// 创建表
	public StringBuilder Create_Table3(String inputDB_ID, String inputTABLE_NAME, String inputCN_NAME, 
			String inputPID_Column, JSONArray temListtable_info,JSONObject t_single_expand) throws Exception
	{
		StringBuilder strResult = new StringBuilder();
		String temTABLE_NAME = inputTABLE_NAME;
		if(!inputTABLE_NAME.equals(""))
		{
			// 判断表库中是否存在
			PooledConnection1 conn1 = DBManager1.getConnection();
			String db_name = conn1.connection.getCatalog();
			conn1.returnConnection();
			JSONArray tb_had = this.SqlToJson(Integer.valueOf(inputDB_ID),"select * FROM information_schema.`TABLES` "
					+ "where TABLE_NAME = '" + temTABLE_NAME
					+ "' and TABLE_SCHEMA='" + db_name + "'");
			if(java.util.Objects.equals(tb_had,null) || tb_had.length() == 0)
			{
				StringBuilder temSql = new StringBuilder();
				temSql.append("CREATE TABLE IF NOT EXISTS `" + temTABLE_NAME
						+ "`( ");
				for(int temIndex = 0;temIndex < temListtable_info.length();temIndex++)
				{
					JSONObject jsoC = temListtable_info.getJSONObject(temIndex);
					String temColumn = jsoC.getString("COLUMN_EN_NAME");
					String COLUMN_TYPE = jsoC.getString("COLUMN_TYPE");
					String COLUMN_LENGTH = jsoC.getString("COLUMN_LENGTH");
					if(temIndex > 0)
						temSql.append(",");
					if(java.util.Objects.equals(temColumn.toUpperCase(),"MAIN_ID"))
						temSql.append(" `" + temColumn
								+ "` int(11) NOT NULL AUTO_INCREMENT");
					else if(java.util.Objects.equals(COLUMN_TYPE,"4"))
						temSql.append(" `" + temColumn
								+ "` datetime DEFAULT now()");
					else if(java.util.Objects.equals(COLUMN_TYPE,"2"))
						temSql.append(" `" + temColumn + "` int(11) DEFAULT 0");
					else if(java.util.Objects.equals(COLUMN_TYPE,"3"))
						temSql.append(" `" + temColumn + "` float DEFAULT 0.0");
					else if(java.util.Objects.equals(COLUMN_TYPE,"1"))
						temSql.append(" `" + temColumn + "` varchar("
								+ COLUMN_LENGTH + ") DEFAULT NULL");
					else
						temSql.append(" `" + temColumn + "` varchar("
								+ COLUMN_LENGTH + ") DEFAULT NULL");
				}
				temSql.append(",PRIMARY KEY (`MAIN_ID`)) DEFAULT CHARSET=utf8;");
				strResult = this.Run_Sql_ByDB(Integer.valueOf(inputDB_ID),temSql);
			}
			// 判断t_table_column和数据库中column是否一致
			else
			{
				tb_had = this.SqlToJson(Integer.valueOf(inputDB_ID),"select * FROM information_schema.`COLUMNS` "
						+ "where TABLE_NAME = '" + temTABLE_NAME
						+ "' and TABLE_SCHEMA='" + db_name + "'");
				for(int temIndex = 0;temIndex < temListtable_info.length();temIndex++)
				{
					JSONObject jsob = temListtable_info.getJSONObject(temIndex);
					boolean bFlag = false;
					for(int jIndex = 0;jIndex < tb_had.length();jIndex++)
					{
						JSONObject jsohad = tb_had.getJSONObject(jIndex);
						if(java.util.Objects.equals(jsob.getString("COLUMN_EN_NAME"),jsohad.getString("COLUMN_NAME")))
						{
							bFlag = true;
							break;
						}
					}
					if(!bFlag)
						strResult.append("配置表中字段"
								+ jsob.getString("COLUMN_EN_NAME")
								+ "在数据库表中不存在,");
				}
			}
			if(strResult.length() == 0)
				this.Create_StaticDB_Interface(inputTABLE_NAME,inputDB_ID,inputCN_NAME,inputPID_Column,"N01",temListtable_info,t_single_expand);
		}
		return strResult;
	}

	// 创建视图接口
	public StringBuilder Create_View_Interface(String inputDB_ID, String inputView_NAME, String inputCN_NAME, String inputPID_Column, String inputViewSql, String inputTN01, JSONArray temtable_info,JSONObject t_single_expand) throws Exception
	{
		StringBuilder strResult = new StringBuilder();
		String inputTABLE_NAME = inputView_NAME;
		JSONObject t_column_expand = new JSONObject();
		StringBuilder strSql = new StringBuilder();
		strSql.append("SELECT a.*,b.COLUMN_EN_NAME FROM t_column_expand a join "
				+"t_table_column b on a.COLUMN_ID = b.MAIN_ID where b.TABLE_ID in "
				+ "(select MAIN_ID from t_single_table where DB_ID = '"+inputDB_ID
				+"' and TABLE_EN_NAME = '"+inputTABLE_NAME+"')");
		JSONArray jsary = this.SqlToJson(1,strSql.toString());
		for(int i = 0; i < jsary.length(); i ++){
    		JSONObject jsoColumn = jsary.getJSONObject(i);
    		String key = jsoColumn.getString("COLUMN_EN_NAME");
        	t_column_expand.put(key,jsoColumn);
    	}
		
		JSONArray temT_PROC_NAME = this.Get_T_PROC_NAME3(inputTN01 + "_sel_"
				+ inputTABLE_NAME);
		if(temT_PROC_NAME.length() == 0)
		{
			T_PROC_NAME T01_sel_DBN_ByID = new T_PROC_NAME();
			T_PROC_NAME T01_sel_DBN_ByPID = new T_PROC_NAME();
			T_PROC_NAME T01_sel_DBN_ByNodeID = new T_PROC_NAME();
			T_PROC_NAME T01_sel_DBN = new T_PROC_NAME();

			T01_sel_DBN_ByID.DB_ID = Integer.valueOf(inputDB_ID);
			T01_sel_DBN_ByPID.DB_ID = Integer.valueOf(inputDB_ID);
			T01_sel_DBN_ByNodeID.DB_ID = Integer.valueOf(inputDB_ID);
			T01_sel_DBN.DB_ID = Integer.valueOf(inputDB_ID);

			T01_sel_DBN_ByID.INF_CN_NAME = "根据ID获取" + inputCN_NAME;
			T01_sel_DBN_ByPID.INF_CN_NAME = "根据父ID获取" + inputCN_NAME;
			T01_sel_DBN_ByNodeID.INF_CN_NAME = "根据树形父节点ID获取" + inputCN_NAME;
			T01_sel_DBN.INF_CN_NAME = "获取所有" + inputCN_NAME;

			T01_sel_DBN_ByID.INF_EN_NAME = inputTN01 + "_sel_" + inputTABLE_NAME
					+ "_ByID";
			T01_sel_DBN_ByPID.INF_EN_NAME = inputTN01 + "_sel_"
					+ inputTABLE_NAME + "_ByPID";
			T01_sel_DBN_ByNodeID.INF_EN_NAME = inputTN01 + "_sel_"
					+ inputTABLE_NAME + "_ByNodeID";
			T01_sel_DBN.INF_EN_NAME = inputTN01 + "_sel_" + inputTABLE_NAME;

			T01_sel_DBN_ByID.INF_TYPE = "2";
			T01_sel_DBN_ByPID.INF_TYPE = "2";
			T01_sel_DBN_ByNodeID.INF_TYPE = "2";
			T01_sel_DBN.INF_TYPE = "2";

			T01_sel_DBN_ByID.CREATE_DATE = new Date();
			T01_sel_DBN_ByPID.CREATE_DATE = new Date();
			T01_sel_DBN_ByNodeID.CREATE_DATE = new Date();
			T01_sel_DBN.CREATE_DATE = new Date();

			T01_sel_DBN_ByID.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_sel_DBN_ByPID.REFLECT_IN_CLASS = "";
			T01_sel_DBN_ByNodeID.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_sel_DBN.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"

			T01_sel_DBN_ByID.IS_AUTHORITY = 1;
			T01_sel_DBN_ByPID.IS_AUTHORITY = 1;
			T01_sel_DBN_ByNodeID.IS_AUTHORITY = 1;
			T01_sel_DBN.IS_AUTHORITY = 1;

			T01_sel_DBN_ByID.INF_EN_SQL = "select ";
			T01_sel_DBN_ByPID.INF_EN_SQL = "select ";
			T01_sel_DBN_ByNodeID.INF_EN_SQL = "select ";
			T01_sel_DBN.INF_EN_SQL = "select ";
			boolean iFalg = false;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				if(java.util.Objects.equals(tti.getString("COLUMN_EN_NAME"),"MAIN_ID"))
				{
					T01_sel_DBN_ByID.INF_EN_SQL = T01_sel_DBN_ByID.INF_EN_SQL
							+ tti.getString("COLUMN_EN_NAME");
					T01_sel_DBN_ByPID.INF_EN_SQL = T01_sel_DBN_ByPID.INF_EN_SQL
							+ tti.getString("COLUMN_EN_NAME");
					if(t_single_expand.length() > 0 && java.util.Objects.equals(tti.getString("COLUMN_EN_NAME"),t_single_expand.getString("S_NAME")))
						T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+"a."
							+ tti.getString("COLUMN_EN_NAME")+",a."+tti.getString("COLUMN_EN_NAME")+" as 'TEXT'";
					else
						T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+"a."
								+ tti.getString("COLUMN_EN_NAME");
					T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ "a."+tti.getString("COLUMN_EN_NAME");
				}else
				{
					String strSp = "";
					if(i != 0){
						strSp = ",";
					}
					T01_sel_DBN_ByID.INF_EN_SQL = T01_sel_DBN_ByID.INF_EN_SQL
							+ strSp + tti.getString("COLUMN_EN_NAME");
					T01_sel_DBN_ByPID.INF_EN_SQL = T01_sel_DBN_ByPID.INF_EN_SQL
							+ strSp + tti.getString("COLUMN_EN_NAME");
					
					if(t_single_expand.length() > 0 && java.util.Objects.equals(tti.getString("COLUMN_EN_NAME"),t_single_expand.getString("S_NAME")))
						T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL
							+ strSp+"a." + tti.getString("COLUMN_EN_NAME")+",a."+tti.getString("COLUMN_EN_NAME")+" as 'TEXT'";
					else{
						if(t_column_expand.has(tti.getString("COLUMN_EN_NAME"))
								&& java.util.Objects.equals(t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("IS_FILE"),"1")){
							T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+ strSp+"a."+tti.getString("COLUMN_EN_NAME");
							T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+ ",a"+t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("MAIN_ID")
									+".NEW_FILE_NAME as '"+tti.getString("COLUMN_EN_NAME")+"_FIND_CN_NAME'";
						}
						else{
							T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL
									+ strSp+"a." + tti.getString("COLUMN_EN_NAME");
						}
					}
					
					if(t_column_expand.has(tti.getString("COLUMN_EN_NAME"))
						&& java.util.Objects.equals(t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("IS_FILE"),"1")){
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL+ strSp+"a."+tti.getString("COLUMN_EN_NAME");
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL+ ",a"+t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("MAIN_ID")
								+".NEW_FILE_NAME as '"+tti.getString("COLUMN_EN_NAME")+"_FIND_CN_NAME'";
					}
					else
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL + strSp
							+ "a."+tti.getString("COLUMN_EN_NAME");
				}
			}

			T01_sel_DBN_ByID.INF_EN_SQL = T01_sel_DBN_ByID.INF_EN_SQL + " from "
					+ inputTABLE_NAME + " where MAIN_ID=?";
			T01_sel_DBN_ByPID.INF_EN_SQL = T01_sel_DBN_ByPID.INF_EN_SQL
					+ " from " + inputTABLE_NAME + " where " + inputPID_Column
					+ "=?";
			T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL
						+ " from " + inputTABLE_NAME + " a ";			
			T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL + " from "
					+ inputTABLE_NAME+" a";
			
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				if(t_column_expand.has(tti.getString("COLUMN_EN_NAME")) 
						&& java.util.Objects.equals(t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("IS_FILE"),"1")){
					String SubTB = t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("MAIN_ID");
					T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL+" left join t_sys_file a"
						+SubTB+" on a."+tti.getString("COLUMN_EN_NAME")+" = a"
						+SubTB+".MAIN_ID ";
					
					T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+" left join t_sys_file a"
							+SubTB+" on a."+tti.getString("COLUMN_EN_NAME")+" = a"
							+SubTB+".MAIN_ID ";
				}
			}
			
			if(t_single_expand.length() > 0)
				T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL +" where find_in_set(a."+t_single_expand.getString("C_NODE")+",funnode_"+inputTABLE_NAME+"(?))";
			else
				T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL +" where find_in_set(a.MAIN_ID,funnode_"+inputTABLE_NAME+"(?))";
			
			// 设置查询条件
			T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL + " where 1=1 ";
			Hashtable htCond = new Hashtable();
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				if(!java.util.Objects.equals(objN.getString("COLUMN_QRY"),"0")
						&& !java.util.Objects.equals(objN.getString("COLUMN_QRY"),""))
				{
					String key = objN.getString("COLUMN_EN_NAME");
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and a." + key + " like concat(\'%\',?,\'%\')";
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and (case when -1=? then 1=1 else a." + key
								+ " = ? end)";
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and a." + key + " = ?";
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and a." + key + " between ? and ?";
					}
				}
			}
			// 设置查找框条件
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				if(java.util.Objects.equals(objN.getString("COLUMN_QRY"),"3"))
				{
					String strkey = objN.getString("COLUMN_EN_NAME");
					if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and " + strkey
								+ " like concat(\'%\',?,\'%\')";
					}else if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and (case when -1=? then 1=1 else "
								+ objN.getString("COLUMN_EN_NAME")
								+ " = ? end)";
					}else if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and " + objN.getString("COLUMN_EN_NAME")
								+ " = ?";
					}else if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and " + objN.getString("COLUMN_EN_NAME")
								+ " between ? and ?";
					}
				}
			}
			int temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN_ByID,"1");
			T_PROC_INPARAM temTpi = new T_PROC_INPARAM();
			temTpi.PROC_ID = temPROC_ID;
			temTpi.CREATE_DATE = new Date();
			temTpi.IS_URLENCODE = 0;
			temTpi.PARAM_CN_NAME = "in_MAIN_ID";
			temTpi.PARAM_EN_NAME = "in_MAIN_ID";
			temTpi.PARAM_TYPE = "INT";
			temTpi.PARAM_SIZE = 50;
			this.Ins_metadata("t_proc_inparam",temTpi,"1");
			T_PROC_RETURN temTpr = new T_PROC_RETURN();
			temTpr.PROC_ID = temPROC_ID;
			temTpr.CREATE_DATE = new Date();
			temTpr.IS_IMG = 0;
			temTpr.IS_URLENCODE = 0;
			temTpr.PROC_ID = temPROC_ID;
			temTpr.RETURN_TYPE = "STRING";
			for(int i = 0;i < temtable_info.length();i++)			   
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME").toUpperCase();
				this.Ins_metadata("t_proc_return",temTpr,"1");
				if(t_column_expand.has(tti.getString("COLUMN_EN_NAME"))){
					temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME").toUpperCase()+"_FIND_CN_NAME";
					this.Ins_metadata("t_proc_return",temTpr,"1");					
				}
			}
			T_SUB_POWER temTsp = new T_SUB_POWER();
			temTsp.CREATE_DATE = new Date();
			temTsp.FIRST_DATE = new Date();
			temTsp.LIMIT_DATE = Com_Fun.StrDateTime("yyyy-MM-dd","2050-01-01");
			temTsp.LIMIT_NUMBER = 10000;
			temTsp.LIMIT_TAG = "3";
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			temTsp.USE_LIMIT = 0;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			T_SUB_USERPOWER temTssp = new T_SUB_USERPOWER();
			temTssp.CREATE_DATE = new Date();
			temTssp.FIRST_DATE = new Date();
			temTssp.LIMIT_DATE = Com_Fun.StrDateTime("yyyy-MM-dd","2050-01-01");
			temTssp.LIMIT_NUMBER = 10000;
			temTssp.LIMIT_TAG = "3";
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			temTssp.USE_LIMIT = 0;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			if(!java.util.Objects.equals(inputPID_Column,""))
			{
				temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN_ByPID,"1");
				temTpi.PROC_ID = temPROC_ID;
				temTpi.PARAM_CN_NAME = "in_PROC_ID";
				temTpi.PARAM_EN_NAME = "in_PROC_ID";
				temTpi.PARAM_TYPE = "INT";
				temTpi.PARAM_SIZE = 50;
				this.Ins_metadata("t_proc_inparam",temTpi,"1");
				temTpr.PROC_ID = temPROC_ID;
				for(int i = 0;i < temtable_info.length();i++)
				{
					JSONObject tti = temtable_info.getJSONObject(i);
					temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME");
					if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"2"))
						temTpr.RETURN_TYPE = "INT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"3"))
						temTpr.RETURN_TYPE = "FLOAT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"1"))
					{
						temTpr.RETURN_TYPE = "STRING";
						temTpr.IS_URLENCODE = 1;
					}else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"4"))
						temTpr.RETURN_TYPE = "DATE";
					this.Ins_metadata("t_proc_return",temTpr,"1");
										   
				}
				temTsp.PROC_ID = temPROC_ID;
				temTsp.SUB_ID = 1;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTsp.SUB_ID = 2;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTssp.PROC_ID = temPROC_ID;
				temTssp.SUB_USER_ID = 1;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
				temTssp.SUB_USER_ID = 2;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
			}
			
			if(t_single_expand.length() > 0)
			{
				temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN_ByNodeID,"1");
				temTpi.PROC_ID = temPROC_ID;
				temTpi.PARAM_CN_NAME = "in_P_CODE";
				temTpi.PARAM_EN_NAME = "in_P_CODE";
				temTpi.PARAM_TYPE = "STRING";
				temTpi.PARAM_SIZE = 200;
				this.Ins_metadata("t_proc_inparam",temTpi,"1");
				temTpr.PROC_ID = temPROC_ID;
				for(int i = 0;i < temtable_info.length();i++)
				{
					JSONObject tti = temtable_info.getJSONObject(i);
					temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME");
					if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"2"))
						temTpr.RETURN_TYPE = "INT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"3"))
						temTpr.RETURN_TYPE = "FLOAT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"1"))
					{
						temTpr.RETURN_TYPE = "STRING";
						temTpr.IS_URLENCODE = 1;											   
					}else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"4"))
						temTpr.RETURN_TYPE = "DATE";
					this.Ins_metadata("t_proc_return",temTpr,"1");
					
					if(java.util.Objects.equals(t_single_expand.getString("S_NAME"),temTpr.RETURN_NAME)){
						temTpr.RETURN_NAME = "TEXT";
						this.Ins_metadata("t_proc_return",temTpr,"1");	   
					}
				}
				temTsp.PROC_ID = temPROC_ID;
				temTsp.SUB_ID = 1;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTsp.SUB_ID = 2;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTssp.PROC_ID = temPROC_ID;
				temTssp.SUB_USER_ID = 1;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
				temTssp.SUB_USER_ID = 2;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
			}
			
			temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN,"1");

			// 查询条件输入参数
			temTpi = new T_PROC_INPARAM();
			temTpi.PROC_ID = temPROC_ID;
			temTpi.CREATE_DATE = new Date();
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				String temCOLUMN_CN_NAME = objN.getString("COLUMN_CN_NAME");
				String temCOLUMN_EN_NAME = objN.getString("COLUMN_EN_NAME");
				if(java.util.Objects.equals(objN.getString("COLUMN_QRY"),"1")
						|| java.util.Objects.equals(objN.getString("COLUMN_QRY"),"2"))
				{
										
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "STRING";
						temTpi.PARAM_SIZE = 500;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "FLOAT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
																																																	 
						temTpi.PARAM_EN_NAME = "qry_begin_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
																																																	 
						temTpi.PARAM_EN_NAME = "qry_end_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}
				}else if(java.util.Objects.equals(objN.getString("COLUMN_QRY"),"3"))
				{
										
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "STRING";
						temTpi.PARAM_SIZE = 500;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "FLOAT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
																																																	  
						temTpi.PARAM_EN_NAME = "qry_begin_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
																																																	  
						temTpi.PARAM_EN_NAME = "qry_end_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}
				}
			}
			temTpr.PROC_ID = temPROC_ID;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				String temCOLUMN_CN_NAME = objN.getString("COLUMN_CN_NAME");
				String temCOLUMN_EN_NAME = objN.getString("COLUMN_EN_NAME");
				temTpr.RETURN_NAME = temCOLUMN_EN_NAME;
				if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					temTpr.RETURN_TYPE = "INT";
				else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					temTpr.RETURN_TYPE = "FLOAT";
				else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
						  
				{
					temTpr.RETURN_TYPE = "STRING";
					temTpr.IS_URLENCODE = 1;
				}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
				{
					temTpr.IS_URLENCODE = 1;
					temTpr.RETURN_TYPE = "STRING";
				}
				this.Ins_metadata("t_proc_return",temTpr,"1");
			}
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
		}
		return strResult;
	}

	private JSONArray Get_T_PROC_NAME3(String inputINF_EN_NAME)
	{

		StringBuilder temStrSql = new StringBuilder();
		JSONArray jsoAry = new JSONArray();
		ResultSet rs = null;
		if(!java.util.Objects.equals(inputINF_EN_NAME,""))
			temStrSql.append("select * from T_PROC_NAME where INF_EN_NAME = '"
					+ inputINF_EN_NAME.trim() + "'");
		else
			temStrSql.append("select * from t_proc_name");
		Db_Common1 dbc1 = new Db_Common1();
		try
		{
			rs = dbc1.Common_Sql(temStrSql);
			jsoAry = Com_Fun.ResultSetToJSON(rs);
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(rs != null)
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return jsoAry;
	}

	// insert元数据中
	private int Ins_metadata(String inputT_TB_NAME, Object objTag, String DB_ID)
	{
		int iResult = -1;
		JSONArray temtable_info = Get_mysql_table_info_ByDB(inputT_TB_NAME,DB_ID);
		StringBuilder temSqlIns = new StringBuilder();
		ResultSet rs = null;
		try
		{
			String[] temParameters = new String[temtable_info.length() - 1];
			String[] temParamTypes = new String[temtable_info.length() - 1];
			String[] temParamOutName = new String[0];
			String[] temParamOutType = new String[0];
			String temStrSql = "insert into " + inputT_TB_NAME + "(";
			String temStrValue = "values(";
			int iIndex = 0;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				String COLUMN_EN_NAME = tti.getString("COLUMN_EN_NAME");
				if(!java.util.Objects.equals(COLUMN_EN_NAME,"MAIN_ID"))
				{
					if(iIndex != 0)
					{
						temStrSql = temStrSql + ",";
						temStrValue = temStrValue + ",";
					}
					temStrSql = temStrSql + COLUMN_EN_NAME;
					temStrValue = temStrValue + "?";
					temParameters[iIndex] = Com_Fun.NoNull(Com_Fun.getFieldValueByName(COLUMN_EN_NAME,objTag));
					temParamTypes[iIndex] = "STRING";
					iIndex++;
				}
			}
			temSqlIns.append(temStrSql + ") " + temStrValue + ")");

			Db_Common1 dbc1 = new Db_Common1();
			com.zxy.model.T_PROC_NAME trn = new com.zxy.model.T_PROC_NAME();
			trn.INF_TYPE = "2"; // Sql
			trn.INF_EN_SQL = temSqlIns.toString();
			rs = dbc1.Common_Sql_Proc("Ins_metadata",temParameters,temParamTypes,temParamOutName,temParamOutType,trn);
			iResult = dbc1.lastrowid;
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
			return -1;
		}
		finally
		{
			try
			{
				if(rs != null)
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
		return iResult;
	}

	// 建立静态配置库某个元数据增删改查的数据接口
	private void Create_StaticDB_Interface(String inputTABLE_NAME, String inputDB_ID, String inputCN_NAME, String inputPID_Column, String inputTN01, JSONArray temtable_info,JSONObject t_single_expand) throws JSONException
	{
		JSONObject t_column_expand = new JSONObject();
		StringBuilder strSql = new StringBuilder();
		strSql.delete(0,strSql.length());
		strSql.append("SELECT a.*,b.COLUMN_EN_NAME FROM t_column_expand a join "
				+"t_table_column b on a.COLUMN_ID = b.MAIN_ID where b.TABLE_ID in "
				+ "(select MAIN_ID from t_single_table where DB_ID = '"+inputDB_ID
				+"' and TABLE_EN_NAME = '"+inputTABLE_NAME+"')");
		JSONArray jsary = this.SqlToJson(1,strSql.toString());
		for(int i = 0; i < jsary.length(); i ++){
    		JSONObject jsoColumn = jsary.getJSONObject(i);
    		String key = jsoColumn.getString("COLUMN_EN_NAME");
        	t_column_expand.put(key,jsoColumn);
    	}
		
		JSONArray temT_PROC_NAME = this.Get_T_PROC_NAME3(inputTN01 + "_sel_"
				+ inputTABLE_NAME);
		if(temT_PROC_NAME.length() == 0)
		{
			T_PROC_NAME T01_sel_DBN_ByID = new T_PROC_NAME();
			T_PROC_NAME T01_sel_DBN_ByPID = new T_PROC_NAME();
			T_PROC_NAME T01_sel_DBN_ByNodeID = new T_PROC_NAME();
			T_PROC_NAME T01_sel_DBN = new T_PROC_NAME();
			T_PROC_NAME T01_ins_DBN = new T_PROC_NAME();
			T_PROC_NAME T01_upd_DBN = new T_PROC_NAME();
			T_PROC_NAME T01_del_DBN_ByID = new T_PROC_NAME();

			T01_sel_DBN_ByID.DB_ID = Integer.valueOf(inputDB_ID);
			T01_sel_DBN_ByPID.DB_ID = Integer.valueOf(inputDB_ID);
			T01_sel_DBN_ByNodeID.DB_ID = Integer.valueOf(inputDB_ID);
			T01_sel_DBN.DB_ID = Integer.valueOf(inputDB_ID);
			T01_ins_DBN.DB_ID = Integer.valueOf(inputDB_ID);
			T01_upd_DBN.DB_ID = Integer.valueOf(inputDB_ID);
			T01_del_DBN_ByID.DB_ID = Integer.valueOf(inputDB_ID);

			T01_sel_DBN_ByID.INF_CN_NAME = "根据ID获取" + inputCN_NAME;
			T01_sel_DBN_ByPID.INF_CN_NAME = "根据父ID获取" + inputCN_NAME;
			T01_sel_DBN_ByNodeID.INF_CN_NAME = "根据树形父节点ID获取" + inputCN_NAME;
			T01_sel_DBN.INF_CN_NAME = "获取所有" + inputCN_NAME;
			T01_ins_DBN.INF_CN_NAME = "添加" + inputCN_NAME;
			T01_upd_DBN.INF_CN_NAME = "根据ID修改" + inputCN_NAME;
			T01_del_DBN_ByID.INF_CN_NAME = "根据ID删除" + inputCN_NAME;

			T01_sel_DBN_ByID.INF_EN_NAME = inputTN01 + "_sel_" + inputTABLE_NAME
					+ "_ByID";
			T01_sel_DBN_ByPID.INF_EN_NAME = inputTN01 + "_sel_"
					+ inputTABLE_NAME + "_ByPID";
			T01_sel_DBN_ByNodeID.INF_EN_NAME = inputTN01 + "_sel_"
					+ inputTABLE_NAME + "_ByNodeID";
			T01_sel_DBN.INF_EN_NAME = inputTN01 + "_sel_" + inputTABLE_NAME;
			T01_ins_DBN.INF_EN_NAME = inputTN01 + "_ins_" + inputTABLE_NAME;
			T01_upd_DBN.INF_EN_NAME = inputTN01 + "_upd_" + inputTABLE_NAME;
			T01_del_DBN_ByID.INF_EN_NAME = inputTN01 + "_del_"
					+ inputTABLE_NAME;

			T01_sel_DBN_ByID.INF_TYPE = "2";
			T01_sel_DBN_ByPID.INF_TYPE = "2";
			T01_sel_DBN_ByNodeID.INF_TYPE = "2";
			T01_sel_DBN.INF_TYPE = "2";
			T01_ins_DBN.INF_TYPE = "2";
			T01_upd_DBN.INF_TYPE = "2";
			T01_del_DBN_ByID.INF_TYPE = "2";

			T01_sel_DBN_ByID.CREATE_DATE = new Date();// Com_Fun.DateTimeStr("yyyy-MM-dd
														// HH:mm:ss");
			T01_sel_DBN_ByPID.CREATE_DATE = new Date();// Com_Fun.DateTimeStr("yyyy-MM-dd
			T01_sel_DBN_ByNodeID.CREATE_DATE = new Date();// HH:mm:ss");
			T01_sel_DBN.CREATE_DATE = new Date();// Com_Fun.DateTimeStr("yyyy-MM-dd
													// HH:mm:ss");
			T01_ins_DBN.CREATE_DATE = new Date();// Com_Fun.DateTimeStr("yyyy-MM-dd
													// HH:mm:ss");
			T01_upd_DBN.CREATE_DATE = new Date();// Com_Fun.DateTimeStr("yyyy-MM-dd
													// HH:mm:ss");
			T01_del_DBN_ByID.CREATE_DATE = new Date();// Com_Fun.DateTimeStr("yyyy-MM-dd
														// HH:mm:ss");

			T01_sel_DBN_ByID.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_sel_DBN_ByPID.REFLECT_IN_CLASS = "";
			T01_sel_DBN_ByNodeID.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_sel_DBN.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_ins_DBN.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_upd_DBN.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"
			T01_del_DBN_ByID.REFLECT_IN_CLASS = "";// #"com.zxy.interfaceReflect.A01_DevGrants"

			T01_sel_DBN_ByID.IS_AUTHORITY = 1;
			T01_sel_DBN_ByPID.IS_AUTHORITY = 1;
			T01_sel_DBN_ByNodeID.IS_AUTHORITY = 1;
			T01_sel_DBN.IS_AUTHORITY = 1;
			T01_ins_DBN.IS_AUTHORITY = 1;
			T01_upd_DBN.IS_AUTHORITY = 1;
			T01_del_DBN_ByID.IS_AUTHORITY = 1;

			T01_sel_DBN_ByID.INF_EN_SQL = "select ";
			T01_sel_DBN_ByPID.INF_EN_SQL = "select ";
			T01_sel_DBN_ByNodeID.INF_EN_SQL = "select ";
			T01_sel_DBN.INF_EN_SQL = "select ";
			T01_ins_DBN.INF_EN_SQL = "insert into " + inputTABLE_NAME + "(";
			String ins_value = "values(";
			T01_upd_DBN.INF_EN_SQL = "update " + inputTABLE_NAME + " set ";
			T01_del_DBN_ByID.INF_EN_SQL = "delete from " + inputTABLE_NAME;
			boolean iFalg = false;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				if(java.util.Objects.equals(tti.getString("COLUMN_EN_NAME"),"MAIN_ID"))
				{
					T01_sel_DBN_ByID.INF_EN_SQL = T01_sel_DBN_ByID.INF_EN_SQL
							+ tti.getString("COLUMN_EN_NAME");
					T01_sel_DBN_ByPID.INF_EN_SQL = T01_sel_DBN_ByPID.INF_EN_SQL
							+ tti.getString("COLUMN_EN_NAME");
					if(t_single_expand.length() > 0 && java.util.Objects.equals(tti.getString("COLUMN_EN_NAME"),t_single_expand.getString("S_NAME")))
						T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+"a."
							+ tti.getString("COLUMN_EN_NAME")+",a."+tti.getString("COLUMN_EN_NAME")+" as 'TEXT'";
					else
						T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+"a."
								+ tti.getString("COLUMN_EN_NAME");
					T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ "a."+tti.getString("COLUMN_EN_NAME");
				}else
				{
					T01_sel_DBN_ByID.INF_EN_SQL = T01_sel_DBN_ByID.INF_EN_SQL
							+ "," + tti.getString("COLUMN_EN_NAME");
					T01_sel_DBN_ByPID.INF_EN_SQL = T01_sel_DBN_ByPID.INF_EN_SQL
							+ "," + tti.getString("COLUMN_EN_NAME");
					
					if(t_single_expand.length() > 0 && java.util.Objects.equals(tti.getString("COLUMN_EN_NAME"),t_single_expand.getString("S_NAME")))
						T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL
							+ ",a." + tti.getString("COLUMN_EN_NAME")+",a."+tti.getString("COLUMN_EN_NAME")+" as 'TEXT'";
					else{
						if(t_column_expand.has(tti.getString("COLUMN_EN_NAME"))
								&& java.util.Objects.equals(t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("IS_FILE"),"1")){
							T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+ ",a."+tti.getString("COLUMN_EN_NAME");
							T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+ ",a"+t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("MAIN_ID")
									+".NEW_FILE_NAME as '"+tti.getString("COLUMN_EN_NAME")+"_FIND_CN_NAME'";
						}
						else{
							T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL
									+ ",a." + tti.getString("COLUMN_EN_NAME");
						}
					}
					
					if(t_column_expand.has(tti.getString("COLUMN_EN_NAME"))
						&& java.util.Objects.equals(t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("IS_FILE"),"1")){
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL+ ",a."+tti.getString("COLUMN_EN_NAME");
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL+ ",a"+t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("MAIN_ID")
								+".NEW_FILE_NAME as '"+tti.getString("COLUMN_EN_NAME")+"_FIND_CN_NAME'";
					}
					else
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL + ","
							+ "a."+tti.getString("COLUMN_EN_NAME");
					if(iFalg == false)
					{
						iFalg = true;
						T01_ins_DBN.INF_EN_SQL = T01_ins_DBN.INF_EN_SQL
								+ tti.getString("COLUMN_EN_NAME");
						ins_value = ins_value + "?";
						T01_upd_DBN.INF_EN_SQL = T01_upd_DBN.INF_EN_SQL + " "
								+ tti.getString("COLUMN_EN_NAME") + "=?";
					}else
					{
						T01_ins_DBN.INF_EN_SQL = T01_ins_DBN.INF_EN_SQL + ","
								+ tti.getString("COLUMN_EN_NAME");
						ins_value = ins_value + ",?";
						T01_upd_DBN.INF_EN_SQL = T01_upd_DBN.INF_EN_SQL + ","
								+ tti.getString("COLUMN_EN_NAME") + "=?";
					}
				}
			}

			T01_sel_DBN_ByID.INF_EN_SQL = T01_sel_DBN_ByID.INF_EN_SQL + " from "
					+ inputTABLE_NAME + " where MAIN_ID=?";
			T01_sel_DBN_ByPID.INF_EN_SQL = T01_sel_DBN_ByPID.INF_EN_SQL
					+ " from " + inputTABLE_NAME + " where " + inputPID_Column
					+ "=?";
			T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL
						+ " from " + inputTABLE_NAME + " a ";			
			T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL + " from "
					+ inputTABLE_NAME+" a";
			
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				if(t_column_expand.has(tti.getString("COLUMN_EN_NAME")) 
						&& java.util.Objects.equals(t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("IS_FILE"),"1")){
					String SubTB = t_column_expand.getJSONObject(tti.getString("COLUMN_EN_NAME")).getString("MAIN_ID");
					T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL+" left join t_sys_file a"
						+SubTB+" on a."+tti.getString("COLUMN_EN_NAME")+" = a"
						+SubTB+".MAIN_ID ";
					
					T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL+" left join t_sys_file a"
							+SubTB+" on a."+tti.getString("COLUMN_EN_NAME")+" = a"
							+SubTB+".MAIN_ID ";
				}
			}
			
			if(t_single_expand.length() > 0)
				T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL +" where find_in_set(a."+t_single_expand.getString("C_NODE")+",funnode_"+inputTABLE_NAME+"(?))";
			else
				T01_sel_DBN_ByNodeID.INF_EN_SQL = T01_sel_DBN_ByNodeID.INF_EN_SQL +" where find_in_set(a.MAIN_ID,funnode_"+inputTABLE_NAME+"(?))";
			
			T01_ins_DBN.INF_EN_SQL = T01_ins_DBN.INF_EN_SQL + ") " + ins_value
					+ ")";
			T01_upd_DBN.INF_EN_SQL = T01_upd_DBN.INF_EN_SQL
					+ " where MAIN_ID=?";
			T01_del_DBN_ByID.INF_EN_SQL = T01_del_DBN_ByID.INF_EN_SQL
					+ " where MAIN_ID =?";

			// 设置查询条件
			T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL + " where 1=1 ";
			Hashtable htCond = new Hashtable();
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				if(!java.util.Objects.equals(objN.getString("COLUMN_QRY"),"0")
						&& !java.util.Objects.equals(objN.getString("COLUMN_QRY"),""))
				{
					String key = objN.getString("COLUMN_EN_NAME");
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and a." + key + " like concat(\'%\',?,\'%\')";
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and (case when -1=? then 1=1 else a." + key
								+ " = ? end)";
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and a." + key + " = ?";
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						htCond.put(key,key);
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and a." + key + " between ? and ?";
					}
				}
			}
			// 设置查找框条件
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				if(java.util.Objects.equals(objN.getString("COLUMN_QRY"),"3"))
				{
					String strkey = objN.getString("COLUMN_EN_NAME");
					if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and " + strkey
								+ " like concat(\'%\',?,\'%\')";
					}else if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and (case when -1=? then 1=1 else "
								+ objN.getString("COLUMN_EN_NAME")
								+ " = ? end)";
					}else if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and " + objN.getString("COLUMN_EN_NAME")
								+ " = ?";
					}else if(!htCond.contains(strkey) && java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						T01_sel_DBN.INF_EN_SQL = T01_sel_DBN.INF_EN_SQL
								+ " and " + objN.getString("COLUMN_EN_NAME")
								+ " between ? and ?";
					}
				}
			}
			int temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN_ByID,"1");
			T_PROC_INPARAM temTpi = new T_PROC_INPARAM();
			temTpi.PROC_ID = temPROC_ID;
			temTpi.CREATE_DATE = new Date();
			temTpi.IS_URLENCODE = 0;
			temTpi.PARAM_CN_NAME = "in_MAIN_ID";
			temTpi.PARAM_EN_NAME = "in_MAIN_ID";
			temTpi.PARAM_TYPE = "INT";
			temTpi.PARAM_SIZE = 50;
			this.Ins_metadata("t_proc_inparam",temTpi,"1");
			T_PROC_RETURN temTpr = new T_PROC_RETURN();
			temTpr.PROC_ID = temPROC_ID;
			temTpr.CREATE_DATE = new Date();
			temTpr.IS_IMG = 0;
			temTpr.IS_URLENCODE = 0;
			temTpr.PROC_ID = temPROC_ID;
			temTpr.RETURN_TYPE = "STRING";
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject tti = temtable_info.getJSONObject(i);
				temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME").toUpperCase();
				this.Ins_metadata("t_proc_return",temTpr,"1");
				if(t_column_expand.has(tti.getString("COLUMN_EN_NAME"))){
					temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME").toUpperCase()+"_FIND_CN_NAME";
					this.Ins_metadata("t_proc_return",temTpr,"1");					
				}
			}
			T_SUB_POWER temTsp = new T_SUB_POWER();
			temTsp.CREATE_DATE = new Date();
			temTsp.FIRST_DATE = new Date();
			temTsp.LIMIT_DATE = Com_Fun.StrDateTime("yyyy-MM-dd","2050-01-01");
			temTsp.LIMIT_NUMBER = 10000;
			temTsp.LIMIT_TAG = "3";
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			temTsp.USE_LIMIT = 0;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			T_SUB_USERPOWER temTssp = new T_SUB_USERPOWER();
			temTssp.CREATE_DATE = new Date();
			temTssp.FIRST_DATE = new Date();
			temTssp.LIMIT_DATE = Com_Fun.StrDateTime("yyyy-MM-dd","2050-01-01");
			temTssp.LIMIT_NUMBER = 10000;
			temTssp.LIMIT_TAG = "3";
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			temTssp.USE_LIMIT = 0;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			if(!java.util.Objects.equals(inputPID_Column,""))
			{
				temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN_ByPID,"1");
				temTpi.PROC_ID = temPROC_ID;
				temTpi.PARAM_CN_NAME = "in_PROC_ID";
				temTpi.PARAM_EN_NAME = "in_PROC_ID";
				temTpi.PARAM_TYPE = "INT";
				temTpi.PARAM_SIZE = 50;
				this.Ins_metadata("t_proc_inparam",temTpi,"1");
				temTpr.PROC_ID = temPROC_ID;
				for(int i = 0;i < temtable_info.length();i++)
				{
					JSONObject tti = temtable_info.getJSONObject(i);
					temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME");
					if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"2"))
						temTpr.RETURN_TYPE = "INT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"3"))
						temTpr.RETURN_TYPE = "FLOAT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"1"))
					{
						temTpr.RETURN_TYPE = "STRING";
						temTpr.IS_URLENCODE = 1;
					}else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"4"))
						temTpr.RETURN_TYPE = "DATE";
					this.Ins_metadata("t_proc_return",temTpr,"1");
				}
				temTsp.PROC_ID = temPROC_ID;
				temTsp.SUB_ID = 1;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTsp.SUB_ID = 2;
				this.Ins_metadata("t_sub_power",temTsp,"1");

				temTssp.PROC_ID = temPROC_ID;
				temTssp.SUB_USER_ID = 1;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
				temTssp.SUB_USER_ID = 2;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
			}
			
			if(t_single_expand.length() > 0)
			{
				temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN_ByNodeID,"1");
				temTpi.PROC_ID = temPROC_ID;
				temTpi.PARAM_CN_NAME = "in_P_ID";
				temTpi.PARAM_EN_NAME = "in_P_ID";
				temTpi.PARAM_TYPE = "STRING";
				temTpi.PARAM_SIZE = 200;
				this.Ins_metadata("t_proc_inparam",temTpi,"1");
				temTpr.PROC_ID = temPROC_ID;
				for(int i = 0;i < temtable_info.length();i++)
				{
					JSONObject tti = temtable_info.getJSONObject(i);
					temTpr.RETURN_NAME = tti.getString("COLUMN_EN_NAME");
					if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"2"))
						temTpr.RETURN_TYPE = "INT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"3"))
						temTpr.RETURN_TYPE = "FLOAT";
					else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"1"))
					{
						temTpr.RETURN_TYPE = "STRING";
						temTpr.IS_URLENCODE = 1;
					}else if(java.util.Objects.equals(tti.getString("COLUMN_TYPE"),"4"))
						temTpr.RETURN_TYPE = "DATE";
					this.Ins_metadata("t_proc_return",temTpr,"1");
					
					if(java.util.Objects.equals(t_single_expand.getString("S_NAME"),temTpr.RETURN_NAME)){
						temTpr.RETURN_NAME = "TEXT";
						this.Ins_metadata("t_proc_return",temTpr,"1");
					}
				}
				temTsp.PROC_ID = temPROC_ID;
				temTsp.SUB_ID = 1;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTsp.SUB_ID = 2;
				this.Ins_metadata("t_sub_power",temTsp,"1");

				temTssp.PROC_ID = temPROC_ID;
				temTssp.SUB_USER_ID = 1;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
				temTssp.SUB_USER_ID = 2;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
			}
			
			temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN,"1");

			// 查询条件输入参数
			temTpi = new T_PROC_INPARAM();
			temTpi.PROC_ID = temPROC_ID;
			temTpi.CREATE_DATE = new Date();
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				String temCOLUMN_CN_NAME = objN.getString("COLUMN_CN_NAME");
				String temCOLUMN_EN_NAME = objN.getString("COLUMN_EN_NAME");
				if(java.util.Objects.equals(objN.getString("COLUMN_QRY"),"1")
						|| java.util.Objects.equals(objN.getString("COLUMN_QRY"),"2"))
				{
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "STRING";
						temTpi.PARAM_SIZE = 500;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "FLOAT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = "qry_begin_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = "qry_end_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}
				}else if(java.util.Objects.equals(objN.getString("COLUMN_QRY"),"3"))
				{
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "STRING";
						temTpi.PARAM_SIZE = 500;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						temTpi.IS_URLENCODE = 0;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "FLOAT";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = "qry_begin_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");

						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
						temTpi.PARAM_EN_NAME = "qry_end_" + temCOLUMN_EN_NAME;
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						this.Ins_metadata("t_proc_inparam",temTpi,"1");
					}
				}
			}
			temTpr.PROC_ID = temPROC_ID;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				String temCOLUMN_CN_NAME = objN.getString("COLUMN_CN_NAME");
				String temCOLUMN_EN_NAME = objN.getString("COLUMN_EN_NAME");
				temTpr.RETURN_NAME = temCOLUMN_EN_NAME;
				if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					temTpr.RETURN_TYPE = "INT";
				else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					temTpr.RETURN_TYPE = "FLOAT";
				else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
				{
					temTpr.RETURN_TYPE = "STRING";
					temTpr.IS_URLENCODE = 1;
				}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
				{
					temTpr.IS_URLENCODE = 1;
					temTpr.RETURN_TYPE = "STRING";
				}
				this.Ins_metadata("t_proc_return",temTpr,"1");
			}
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temPROC_ID = this.Ins_metadata("t_proc_name",T01_ins_DBN,"1");
			temTpi.PROC_ID = temPROC_ID;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				String temCOLUMN_CN_NAME = objN.getString("COLUMN_CN_NAME");
				String temCOLUMN_EN_NAME = objN.getString("COLUMN_EN_NAME");
				if(java.util.Objects.equals(temCOLUMN_EN_NAME,"MAIN_ID"))
				{
				}else
				{
					temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
					temTpi.PARAM_EN_NAME = "in_" + temCOLUMN_EN_NAME;
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						temTpi.PARAM_TYPE = "FLOAT";
						temTpi.PARAM_SIZE = 50;
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_TYPE = "STRING";
						temTpi.PARAM_SIZE = Integer.valueOf(objN.getString("COLUMN_LENGTH"));
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						temTpi.IS_URLENCODE = 1;
					}
					this.Ins_metadata("t_proc_inparam",temTpi,"1");
				}
			}
			temTpr.PROC_ID = temPROC_ID;
			temTpr.RETURN_NAME = "s_result";
			temTpr.RETURN_TYPE = "INT";
			this.Ins_metadata("t_proc_return",temTpr,"1");
			temTpr.RETURN_NAME = "error_desc";
			temTpr.RETURN_TYPE = "STRING";
			this.Ins_metadata("t_proc_return",temTpr,"1");
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temPROC_ID = this.Ins_metadata("t_proc_name",T01_upd_DBN,"1");
			temTpi.PROC_ID = temPROC_ID;
			for(int i = 0;i < temtable_info.length();i++)
			{
				JSONObject objN = temtable_info.getJSONObject(i);
				String temCOLUMN_CN_NAME = objN.getString("COLUMN_CN_NAME");
				String temCOLUMN_EN_NAME = objN.getString("COLUMN_EN_NAME");
				if(java.util.Objects.equals(temCOLUMN_EN_NAME,"MAIN_ID"))
				{
				}else
				{
					temTpi.PARAM_CN_NAME = temCOLUMN_CN_NAME;
					temTpi.PARAM_EN_NAME = temCOLUMN_EN_NAME;
					if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"2"))
					{
						temTpi.PARAM_TYPE = "INT";
						temTpi.PARAM_SIZE = 50;
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"3"))
					{
						temTpi.PARAM_TYPE = "FLOAT";
						temTpi.PARAM_SIZE = 50;
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"1"))
					{
						temTpi.IS_URLENCODE = 1;
						temTpi.PARAM_TYPE = "STRING";
						temTpi.PARAM_SIZE = Integer.valueOf(objN.getString("COLUMN_LENGTH"));
					}else if(java.util.Objects.equals(objN.getString("COLUMN_TYPE"),"4"))
					{
						temTpi.PARAM_TYPE = "DATE";
						temTpi.PARAM_SIZE = 50;
						temTpi.IS_URLENCODE = 1;
					}
					this.Ins_metadata("t_proc_inparam",temTpi,"1");
				}
			}
			temTpi.PARAM_CN_NAME = "MAIN_ID";
			temTpi.PARAM_EN_NAME = "MAIN_ID";
			temTpi.PARAM_TYPE = "INT";
			temTpi.PARAM_SIZE = 50;
			this.Ins_metadata("t_proc_inparam",temTpi,"1");
			temTpr.PROC_ID = temPROC_ID;
			temTpr.RETURN_NAME = "s_result";
			temTpr.RETURN_TYPE = "INT";
			this.Ins_metadata("t_proc_return",temTpr,"1");
			temTpr.RETURN_NAME = "error_desc";
			temTpr.RETURN_TYPE = "STRING";
			this.Ins_metadata("t_proc_return",temTpr,"1");
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temPROC_ID = this.Ins_metadata("t_proc_name",T01_del_DBN_ByID,"1");
			temTpi.PROC_ID = temPROC_ID;
			temTpi.PARAM_CN_NAME = "in_MAIN_ID";
			temTpi.PARAM_EN_NAME = "in_MAIN_ID";
			temTpi.PARAM_TYPE = "INT";
			temTpi.PARAM_SIZE = 50;
			this.Ins_metadata("t_proc_inparam",temTpi,"1");
			temTpr.PROC_ID = temPROC_ID;
			temTpr.RETURN_NAME = "s_result";
			temTpr.RETURN_TYPE = "INT";
			this.Ins_metadata("t_proc_return",temTpr,"1");
			temTpr.RETURN_NAME = "error_desc";
			temTpr.RETURN_TYPE = "STRING";
			this.Ins_metadata("t_proc_return",temTpr,"1");
			temTsp.PROC_ID = temPROC_ID;
			temTsp.SUB_ID = 1;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTsp.SUB_ID = 2;
			this.Ins_metadata("t_sub_power",temTsp,"1");
			temTssp.PROC_ID = temPROC_ID;
			temTssp.SUB_USER_ID = 1;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
			temTssp.SUB_USER_ID = 2;
			this.Ins_metadata("t_sub_userpower",temTssp,"1");
		}
	}

	// #建立静态配置库某个view数据查询接口
	public StringBuilder Create_StaticView_Interface(String inputDB_ID, String temTABLE_NAME, String inputCN_NAME, String inputPID, String inputTN01, JSONArray table_info) throws JSONException
	{
		StringBuilder strResult = new StringBuilder();
		JSONObject temAtts = new JSONObject(new LinkedHashMap());
		JSONArray temMainSub = new JSONArray();
		JSONObject temLen = new JSONObject(new LinkedHashMap());
		JSONObject temAttCN = new JSONObject(new LinkedHashMap());
		JSONObject temQryAtt = new JSONObject(new LinkedHashMap());
		JSONObject temSelectAtt = new JSONObject(new LinkedHashMap());
		JSONObject temFindAtt = new JSONObject(new LinkedHashMap());
		JSONObject temFReturnAtt = new JSONObject(new LinkedHashMap());

		for(int i = 0;i < table_info.length();i++)
		{
			JSONObject jsoColumn = table_info.getJSONObject(i);
			temAtts.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);
			temLen.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);// .getString("COLUMN_LENGTH"));
			temAttCN.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);// .getString("COLUMN_CN_NAME"));
			// 是否查询条件
			if(!java.util.Objects.equals(jsoColumn.getString("COLUMN_QRY"),"0"))
			{
				temQryAtt.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);// .getString("COLUMN_EN_NAME"));
			}
			// 下拉框
			if(java.util.Objects.equals(jsoColumn.getString("COLUMN_QRY"),"2"))
			{
				temSelectAtt.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);// .getString("COLUMN_QRY_FORMAT"));
			}
			// 查找框
			if(java.util.Objects.equals(jsoColumn.getString("COLUMN_QRY"),"3"))
			{
				temSelectAtt.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);
				temFindAtt.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);// .getString("COLUMN_EN_NAME"));
			}
			// 查找框返回值
			if(!java.util.Objects.equals(jsoColumn.getString("COLUMN_FIND_RETURN"),""))
			{
				temFReturnAtt.put(jsoColumn.getString("COLUMN_EN_NAME"),jsoColumn);// .getString("COLUMN_FIND_RETURN"));
			}
		}

		Iterator iter1 = temAttCN.keys();
		while(iter1.hasNext())
		{
			String key = (String) iter1.next();
			String temValue = temAttCN.getJSONObject(key).getString("COLUMN_QRY_FORMAT");
			T_PROC_NAME temT_PROC_NAME = this.Get_T_PROC_NAME(inputTN01 + "_"
					+ temTABLE_NAME + "$" + key,Integer.valueOf(inputDB_ID));
			boolean bIsList = true;
			try
			{
				JSONObject jsoJD = new JSONObject(temValue);
			}
			catch(Exception en)
			{
				bIsList = false;
			}

			if(!bIsList && temValue.length() > 0 && temT_PROC_NAME.MAIN_ID == -1
					&& temValue.toUpperCase().indexOf("SELECT ") == 0)
			{
				T_PROC_NAME T01_sel_DBN = new T_PROC_NAME();
				T01_sel_DBN.INF_CN_NAME = "获取下拉框" + temTABLE_NAME + "$" + key;
				T01_sel_DBN.INF_EN_NAME = inputTN01 + "_" + temTABLE_NAME + "$"
						+ key;
				T01_sel_DBN.INF_TYPE = "2";
				T01_sel_DBN.CREATE_DATE = new Date();
				T01_sel_DBN.REFLECT_IN_CLASS = "";
				T01_sel_DBN.IS_AUTHORITY = 1;
				T01_sel_DBN.INF_EN_SQL = temAttCN.getJSONObject(key).getString("COLUMN_QRY_FORMAT");
				T01_sel_DBN.DB_ID = Integer.valueOf(inputDB_ID);
				T_PROC_INPARAM temTpi = new T_PROC_INPARAM();
				T_PROC_RETURN temTpr = new T_PROC_RETURN();
				T_SUB_POWER temTsp = new T_SUB_POWER();
				temTsp.CREATE_DATE = new Date();
				temTsp.FIRST_DATE = new Date();
				temTsp.LIMIT_DATE = Com_Fun.StrDateTime("yyyy-MM-dd","2050-01-01");
				temTsp.LIMIT_NUMBER = 10000;
				temTsp.LIMIT_TAG = "3";
				temTsp.SUB_ID = Integer.valueOf(inputDB_ID);
				temTsp.USE_LIMIT = 0;
				T_SUB_USERPOWER temTssp = new T_SUB_USERPOWER();
				temTssp.CREATE_DATE = new Date();
				temTssp.FIRST_DATE = new Date();
				temTssp.LIMIT_DATE = Com_Fun.StrDateTime("yyyy-MM-dd","2050-01-01");
				temTssp.LIMIT_NUMBER = 10000;
				temTssp.LIMIT_TAG = "3";
				temTssp.SUB_USER_ID = Integer.valueOf(inputDB_ID);
				temTssp.USE_LIMIT = 0;
				// #########################
				int temPROC_ID = this.Ins_metadata("t_proc_name",T01_sel_DBN,"1");
				temTpi.PROC_ID = temPROC_ID;
				temTpr.PROC_ID = temPROC_ID;
				temTsp.PROC_ID = temPROC_ID;
				temTssp.PROC_ID = temPROC_ID;

				temTpr.RETURN_NAME = "MAIN_ID";
				temTpr.RETURN_TYPE = "STRING";
				this.Ins_metadata("t_proc_return",temTpr,"1");
				temTpr.RETURN_NAME = "CN_NAME";
				temTpr.RETURN_TYPE = "STRING";
				this.Ins_metadata("t_proc_return",temTpr,"1");

				temTsp.PROC_ID = temPROC_ID;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTsp.SUB_ID = 2;
				this.Ins_metadata("t_sub_power",temTsp,"1");
				temTssp.PROC_ID = temPROC_ID;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
				temTssp.SUB_USER_ID = 2;
				this.Ins_metadata("t_sub_userpower",temTssp,"1");
			}
		}
		return strResult;
	}

	// #获取主从表配置关系信息
	public JSONArray GetMainSubInfo(String inputtable_name, String inputFileFolder)
	{
		StringBuilder temSql = new StringBuilder();
		temSql.append("select a.MAIN_ID,d.TABLE_EN_NAME as MAIN_TABLE_EN_NAME,d.TABLE_CN_NAME as MAIN_TABLE_CN_NAME, b.COLUMN_EN_NAME as MAIN_COLUMN_EN_NAME, ");
		temSql.append("b.COLUMN_CN_NAME as MAIN_COLUMN_CN_NAME,e.TABLE_EN_NAME as SUB_TABLE_EN_NAME,e.TABLE_CN_NAME as SUB_TABLE_CN_NAME, ");
		temSql.append("c.COLUMN_EN_NAME as SUB_COLUMN_EN_NAME,c.COLUMN_CN_NAME as SUB_COLUMN_CN_NAME,f.S_DESC as SUB_RANDOM,a.MAIN_TITLE_COLUMN ");
		temSql.append("From t_main_sub_link a join  t_table_column b on a.MAIN_TB_NAME = b.main_id  ");
		temSql.append("join t_table_column c on a.SUB_TB_NAME = c.MAIN_ID join  t_single_table d on b.table_id = d.MAIN_ID ");
		temSql.append("join  t_single_table e on c.table_id = e.MAIN_ID ");
		temSql.append("join  menu_info f  on   f.menu_url like concat('"
				//+ inputFileFolder
				+ "%',e.TABLE_EN_NAME,'.vue%') where d.TABLE_EN_NAME = '"
				+ inputtable_name + "'");
		return this.SqlToJson(1,temSql.toString());
	}

	//用户登录日志
	public void Ins_t_login_log(String LOGIN_ID,String NICK_NAME,String OPE_IP,String S_DESC){
		ResultSet rs = null;
		try
		{
			Db_Common1 dbc1 = new Db_Common1();
			StringBuilder strSql = new StringBuilder("insert into t_login_log(LOGIN_ID,NICK_NAME,OPE_IP,SYS_DATE,S_DESC,CREATE_DATE) "
					+"values('"+LOGIN_ID+"','"+Com_Fun.s_decode(NICK_NAME)+"','"+OPE_IP
					+"','"+Com_Fun.DateTimeStr("yyyy-MM-dd HH:mm:ss")+"','"
					+S_DESC+"','"+Com_Fun.DateTimeStr("yyyy-MM-dd HH:mm:ss")+"')");
			dbc1.CommonExec_Sql(strSql);
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
		}
		finally
		{
			try
			{
				if(rs != null)
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
	}
	
	// 根据从表外键获取主表主键
	public String get_key_by_foreignkey(String table_name,String key,String foreignkey,String temValue)
	{
		Db_Common_Self dbcs = new Db_Common_Self();
		String strSql = "select "+key+" as 'NNN_XXX' from "+table_name+" where "+foreignkey+" = '"
				+ temValue + "'";
		ResultSet rs = null;
		try
		{
			rs = dbcs.Common_Sql(new StringBuilder(strSql));
			while(rs.next())
			{
				return rs.getString("NNN_XXX");
			}
			return "";
		}
		catch(Exception es)
		{
			Com_Fun.debug_in(es,this.toString());
			return "";
		}
		finally
		{
			try
			{
				if(!java.util.Objects.equals(rs,null))
				{
					rs.getStatement().close();
					rs.close();
				}
			}
			catch(SQLException e)
			{
			}
		}
	}
}